I am trying to make a series of inapp purchases one after other. This is how the code is setup. Make a call to purchase item by calling launchPurchaseFlow.

Now on public void onIabPurchaseFinished() I make the next call for purchase. The first call works fine. But the second call fails by throwing the exception

java.lang.IllegalStateException: Can't start async operation (launchPurchaseFlow) because another async operation(launchPurchaseFlow) is in progress.

How to make this work?

Thanks

有帮助吗?

解决方案

Are you using the IABHelper class?

If so, some people have reported success making the flagEndAsync method public and calling it before starting a new purchase.

More info: Android in-app billing: Can't start async operation because another async operation (is in progress)

其他提示

That is most likely because the first request has not yet finished; it would finish when you return from onIabPurchaseFinished(); the async request is not finished inside that function.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top