我试图在应用帐单v3中隐含android,并且我的应用程序崩溃并显示以下错误无法启动异步操作(使用),因为正在进行另一个异步操作(使用)
堆栈跟踪如下
02-25 16:56:54.811: E/AndroidRuntime(6913): FATAL EXCEPTION: main
02-25 16:56:54.811: E/AndroidRuntime(6913): java.lang.IllegalStateException: Can't start async operation (consume) because another async operation(consume) is in progress.
02-25 16:56:54.811: E/AndroidRuntime(6913): at com.seven.BillingHelper.IabHelper.flagStartAsync(IabHelper.java:711)
02-25 16:56:54.811: E/AndroidRuntime(6913): at com.seven.BillingHelper.IabHelper.consumeAsyncInternal(IabHelper.java:832)
02-25 16:56:54.811: E/AndroidRuntime(6913): at com.seven.BillingHelper.IabHelper.consumeAsync(IabHelper.java:623)
02-25 16:56:54.811: E/AndroidRuntime(6913): at com.seven.javalib.InAppBilling$15.run(InAppBilling.java:350)
02-25 16:56:54.811: E/AndroidRuntime(6913): at android.os.Handler.handleCallback(Handler.java:587)
02-25 16:56:54.811: E/AndroidRuntime(6913): at android.os.Handler.dispatchMessage(Handler.java:92)
02-25 16:56:54.811: E/AndroidRuntime(6913): at android.os.Looper.loop(Looper.java:143)
02-25 16:56:54.811: E/AndroidRuntime(6913): at android.app.ActivityThread.main(ActivityThread.java:4196)
02-25 16:56:54.811: E/AndroidRuntime(6913): at java.lang.reflect.Method.invokeNative(Native Method)
02-25 16:56:54.811: E/AndroidRuntime(6913): at java.lang.reflect.Method.invoke(Method.java:507)
02-25 16:56:54.811: E/AndroidRuntime(6913): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-25 16:56:54.811: E/AndroidRuntime(6913): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-25 16:56:54.811: E/AndroidRuntime(6913): at dalvik.system.NativeStart.main(Native Method)
谁能告诉我如何解决这个问题
最佳答案
由于先前尝试未调用方法flagEndAsync
的原因,请确保在所有情况下(成功或失败)在IabHelper
中都调用方法flagEndAsync
。
关于android - IAB V3中的IllegalStateException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15066095/