2

For inAppBilling in my app use Bazaar(Iranian Android Market) API.

All things are right but in in Android 5 Lollipop this not work correctly and return error :

enter image description here

After many search found this similar problem and this link too this one.(solutions are similar together)

So I try to adding this line :

  serviceIntent.setPackage("ir.cafebazaar.pardakht");

After this line:

  Intent serviceIntent = new Intent("ir.cafebazaar.pardakht.InAppBillingService.BIND");

Now app return this Errors :

java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference
        at farahang.tedAmouz.BzrBl.util.IabHelper.Setuping(IabHelper.java:227)
        at farahang.tedAmouz.adapters.slideMenuAdapter.onClick(slideMenuAdapter.java:155)

Codes work completely-correctly in under Android 5 Lollipop versions just have problem with Android 5 Lollipop!

Community
  • 1
  • 1
Saeid
  • 2,261
  • 4
  • 27
  • 59

1 Answers1

4

For binding play services we do something like this:

Intent i = new Intent("com.android.vending.billing.InAppBillingService.BIND");
i.setPackage("com.android.vending");
mContext.bindService(e, this.serviceConnection, Context.BIND_AUTO_CREATE);

Maybe there is something wrong with your setPackage replace it with

i.setPackage("com.farsitel.bazaar");

Instead of

i.setPackage("ir.cafebazaar.pardakht");
Saeed Masoumi
  • 8,746
  • 7
  • 57
  • 76