I get an explicit intentional exception on some 5.0 devices, however my code already has an explicit intent and looks like this:
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
PackageManager pm=mContext.getPackageManager();
List<ResolveInfo> intentServices = pm.queryIntentServices(serviceIntent, 0);
if (intentServices != null && !intentServices.isEmpty()){
mContext.bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
} else {
if (listener != null) {
listener.onIabSetupFinished(
new IabResult(BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE,
"Billing service unavailable on device."));
}
}
The exception that I get is the following:
Non-fatal Exception: java.lang.IllegalArgumentException
Service Intent must be explicit: Intent { act=com.android.vending.billing.InAppBillingService.BIND }
android.app.ContextImpl.validateServiceIntent (ContextImpl.java:1681)
android.content.ContextWrapper.bindService (ContextWrapper.java:538)
IabHelper.startSetup (IabHelper.java:272)
MyApp.createIABHelper (MyApp.java:256)
MyApp.onCreate (MyApp.java:156)
android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1011)
android.app.ActivityThread.handleBindApplication (ActivityThread.java:4520)
android.app.ActivityThread.access$1500 (ActivityThread.java:144)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1339)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5223)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:693)
I'm not sure what I'm doing wrong, every search I do brings serviceIntent.setPackage("com.android.vending");as a fix, but my code already has this.
Thank.
source
share