onIabPurchaseFinished never called.

前端 未结 5 2135
野性不改
野性不改 2020-11-29 17:55

I\'ve been trying to set up in-app billing for my first app, and have been using the android.test.purchased sku. The purchase come through, and I manage to get the SKU into

5条回答
  •  萌比男神i
    2020-11-29 18:40

    Try adding this to the Activity that calls mHelper.launchPurchaseFlow(..):

        @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        Log.d(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data);
    
        // Pass on the activity result to the helper for handling
        if (!mHelper.handleActivityResult(requestCode, resultCode, data)) {
            // not handled, so handle it ourselves (here's where you'd
            // perform any handling of activity results not related to in-app
            // billing...
            super.onActivityResult(requestCode, resultCode, data);
        }
        else {
            Log.d(TAG, "onActivityResult handled by IABUtil.");
        }
    }
    

提交回复
热议问题