1

I had the in-app billing integrated in one activity, accessed through the preference menu of the livewallpaper, and it's working fine and dandy. That is, until I tried to cancel an app purchase. The app crashes once I tried to cancel.

FATAL EXCEPTION: main
java.lang.NullPointerException
at com.google.android.finsky.billing.iab.MarketBillingService$BillingNotifier.showStatusBarNotifications(MarketBillingService.java:733)
at com.google.android.finsky.billing.iab.MarketBillingService$Stub$1.onResponse(MarketBillingService.java:482)
at com.google.android.finsky.billing.iab.MarketBillingService$Stub$1.onResponse(MarketBillingService.java:474)
at com.google.android.vending.remoting.api.VendingRequest.deliverResponse(VendingRequest.java:141)
at com.google.android.vending.remoting.api.VendingRequest.deliverResponse(VendingRequest.java:40)
at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:113)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4680)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)

The only way I have figured out how to remove this crash is to declare the activity with the following tags:

<!-- BTW, I cannot put this tag on the livewallpaper service itself.  It has to be an activity.  In my case, this activity is some sort of a purchase window. -->
<intent-filter>
   <action android:name="android.intent.action.MAIN" />
   <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Unfortunately, now that this app is both a launcher and a livewallpaper, there is now an icon in the main menu, and it launches the activity that was tagged earlier. The only way I know how to remove the icon is to removing the LAUNCHER tag programmatically. I don't think this will fly because the in-app billing requires the LAUNCHER tag in the first place, otherwise it will crash again.

Does anyone here have done an in-app billing inside a livewallpaper? Is there any other way to remove this crash? Or maybe a way to remove the icon without removing the LAUNCHER tag?

Battlecity
  • 41
  • 9

0 Answers0