如果我通过标准发送购买意向
String mySku = "android.test.purchased";
mHelper.launchPurchaseFlow(this, mySku, 10001, mPurchaseFinishedListener);
我可以购买该物品,它会存储,我可以查询该物品,而且效果也很好。唯一不起作用的是 PurchaseFinishedListener。我的代码与示例应用程序几乎相同,但它似乎根本没有被调用。
12-12 01:40:47.248: D/IabHelper(23502): Calling getPurchases with continuation token: null
12-12 01:40:50.116: D/IabHelper(23502): Starting async operation: launchPurchaseFlow
这些是最后两个被调用的方法,之后当我完成购买时它不会调用 purchasefinishedlistener
IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener = new OnIabPurchaseFinishedListener() {
@Override
public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
Log.d(TAG, "Purchase finished: " + result + ", purchase: "
+ purchase);
if (result.isFailure()) {
complain("Error purchasing: " + result);
// setWaitScreen(false);
return;
}
if (purchase.getSku().equals(mySku)) {
Log.d(TAG, "mySku is being consumed.");
mHelper.consumeAsync(purchase, mConsumeFinishedListener);
}
Log.d(TAG, "Purchase successful.");
new AsyncQuestionsActivity().doInBackground();
}
};
从日志到最后没有任何效果。有什么我只是想念的东西吗?