4

I've implemented the new IAB in my application, but when I tested it on two different device the result were different on galaxy S3 the flow was great but on galaxy S1 (gt-i9000), after purchasing onActivityResult method isn't called and the application restarts.

any suggestions?

atreo
  • 171
  • 2
  • 6
  • facing same problem : works fine one activity of my app while not in another activity with same signature of code on documenataion – NavinRaj Pandey Mar 04 '15 at 05:50

3 Answers3

4

I had the same problem, in my case the reason was that I had a flag set in the intent that called the activity which hosted the purchase process

i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);

after removing the flag it works, I guess it is because when the startIntentSenderForResult starts the purchase interface the activity is destroyed, not kept in history and somehow there is no point to handle the onActivityResult

Lukas Hanacek
  • 1,364
  • 14
  • 25
  • This is an old issue, but I just caught by this on the second app I added v3 to. I was definitely not looking in this direction, so thanks for saving me lots of time. – ProjectJourneyman Sep 26 '14 at 00:42
  • Omg, you are my hero! Why hasn't Google fixed this already, or at least documented it somewhere? – Johan Paul Jun 07 '16 at 16:03
0

Are you using TABActivity? If answrer is yes than procedure is somewhat different,As the onActvityResult will be called for the parent class which is your activity that extends TABActivity,I dont know why but it seems that parent is cathcing the onActivityResult.So your code for startActvityForResult or startIntentSenderForResult should be in that actvity.

i used this link and made some changes according to my app and it works

onActivityResult is never called in TabActivity

Community
  • 1
  • 1
kaushal trivedi
  • 3,405
  • 3
  • 29
  • 47
0

My gremlin for this problem was using a negative requestCode. That breaks the result dispatching mechanism.

nmr
  • 16,625
  • 10
  • 53
  • 67