midhunhk / message-counter

A native Android App which tracks the number of Text messages sent in a cycle written in Kotlin
https://midhunhk.com/message-counter/
Apache License 2.0
21 stars 10 forks source link

IllegalStateException after doing Donation #38

Closed midhunhk closed 7 years ago

midhunhk commented 7 years ago

An IllegalStateException with IabHelper.flagAsync is thrown after a donation is made from the DonationsActivity. Afterwards the same SKU cannot be selected, the dialog box shows a spinner instead.

StackTrace:

java.lang.IllegalStateException: at com.ae.apps.common.utils.inapp.IabHelper.flagStartAsync (IabHelper.java:819) at com.ae.apps.common.utils.inapp.IabHelper.launchPurchaseFlow (IabHelper.java:373) at com.ae.apps.common.utils.inapp.IabHelper.launchPurchaseFlow (IabHelper.java:338) at com.ae.apps.common.activities.DonationsBaseActivity.launchPurchaseFlow (DonationsBaseActivity.java:86) at com.ae.apps.messagecounter.activities.DonationsActivity.access$000 (DonationsActivity.java:39) at com.ae.apps.messagecounter.activities.DonationsActivity$1.onClick (DonationsActivity.java:88)

Seems to be duplicate of Issue #33

midhunhk commented 7 years ago

More leads

midhunhk commented 7 years ago

The code in DonationsActivity seems to be written correctly as per standards.

  1. There might be an issue with the button not being disabled and the user double clicks on the button as in the below answer. https://stackoverflow.com/a/33905606/592025

  2. One solution suggested from SO is to make flagEndAsync as public and call it manually on completion of listeners. This change needs to be done in AeAppsLib project https://stackoverflow.com/a/18297249/592025