Friday, 27 September 2013

How do I restore the state of the In-app billing IabHelper?

How do I restore the state of the In-app billing IabHelper?

I have an issue with the IabHelper when I rotate my device.
If I call launchPurchaseFlow with a requestCode of 6, the in-app billing
dialog opens.
If I rotate the device, the dialog stays open, but when I close it,
onActivityResult gets called, and the IabHelper's handleActivityResult
method is called, but the initial check for the matching requestCode fails
because the IabHelper was nulled from the Activity's onDestroy method.
This failure makes it so my onPurchasedFinishedListener does not get
called.
I need help because it is very important that the listener is called. I'm
surprised this hasn't been reported, since the docs recommend you destroy
the IabHelper in onDestroy.. Am I missing something?

No comments:

Post a Comment