在Android上完成购买时出错

时间:2014-10-29 09:53:53

标签: android in-app-purchase

我使用以下代码启动购买:

mHelper.launchPurchaseFlow(this, CoreApp.SKU_CHAPTER2, 10001, mPurchaseFinishedListener, "");

然后我有mPurchaseFinishedListener:

mPurchaseFinishedListener= new IabHelper.OnIabPurchaseFinishedListener() {
            public void onIabPurchaseFinished(IabResult result, Purchase purchase)
            {
                Log.d("Finish Purchase","Started");
                if (result.isFailure()) {
                    Log.d("Finish Purchase","Failure "+result.getMessage());
                    return;
                }

                if (purchase.getSku().equals(CoreApp.SKU_CHAPTER2)) {
                    CoreApp.in_app_chapter_2 = true;
                }
}

但是在购买之后,mPurchaseFinishedListener没有被执行,即使我得到对话框Payment Successful,我知道它因为行CoreApp.in_app_chapter_2 = true没有被执行。为什么没有执行监听器mPurchaseFinishedListener?

0 个答案:

没有答案