Android 应用内购买完成方法不适用';t火

Android 应用内购买完成方法不适用';t火,android,in-app-purchase,in-app-billing,Android,In App Purchase,In App Billing,我想在我的应用程序中使用应用内购买。我举出了很多例子。在完成应用内购买之前,一切正常。我可以买这个产品。它应该在完成流程后调用处理程序,但它不起作用。因此,产品不提供给用户。 代码部分如下: BillingHelper.requestPurchase(activity, productId);  Handler mTransactionHandler = new Handler(){ @Override public void handleMessage(android.os.Message 

我想在我的应用程序中使用应用内购买。我举出了很多例子。在完成应用内购买之前,一切正常。我可以买这个产品。它应该在完成流程后调用处理程序,但它不起作用。因此,产品不提供给用户。

代码部分如下:

BillingHelper.requestPurchase(activity, productId); 
Handler mTransactionHandler = new Handler(){

@Override
public void handleMessage(android.os.Message msg) {
   Log.i(TAG, "Transaction complete");
   Log.i(TAG, "Transaction status: "+BillingHelper.latestPurchase.purchaseState);
   Log.i(TAG, "Item purchased is: "+BillingHelper.latestPurchase.productId);
   if(BillingHelper.latestPurchase.isPurchased()){
            // my code is here
       }     
    };
};

startService(new Intent(activity, BillingService.class));
BillingHelper.setCompletedHandler(mTransactionHandler);

您知道吗?

您使用的是v2还是v3版本?使用v3是因为v3很容易集成到应用程序中。有关详细信息,请参阅