2017年8月30日

Service Intent must be explicit: Intent { act=com.android.vending.billing.InAppBillingService.BIND }

IabHelper.java

增加一行指令即可!

   public void startSetup(final OnIabSetupFinishedListener listener) {
        // If already set up, can't do it again.
        if (mSetupDone) throw new IllegalStateException("IAB helper is already set up.");
        // Connection to IAB service
        logDebug("Starting in-app billing setup.");
        mServiceConn = new ServiceConnection() {

              .....................省略

        };
       
        Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
        serviceIntent.setPackage("com.android.vending");

              .....................省略

    }

沒有留言: