应用程序中的Android无法启动异步操作

时间:2017-08-29 15:29:10

标签: android in-app-billing iasyncoperation

我是android新手,我的第一个应用程序最近完成了。我想在我的应用程序中设置IAB(在应用程序计费中),我测试了我的应用程序,我遇到了以下问题: 1 - 当我点击"买"按钮eveything正常,付款操作正常运行。但当我关闭应用程序并单击按钮时,我有以下错误。

    java.lang.IllegalStateException: Could not execute method of the activity                                                                                

    at android.view.View$1.onClick(View.java:4015)  
at android.view.View.performClick(View.java:4764)
at android.view.View$PerformClick.run(View.java:19844) 
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:135)      
at android.app.ActivityThread.main(ActivityThread.java:5376) 
at java.lang.reflect.Method.invoke(Native Method)    
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)  
Caused by: java.lang.reflect.InvocationTargetException  
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at android.view.View$1.onClick(View.java:4010)   
at android.view.View.performClick(View.java:4764) 
at android.view.View$PerformClick.run(View.java:19844)    
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)  
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5376)  
at java.lang.reflect.Method.invoke(Native Method)      
at java.lang.reflect.Method.invoke(Method.java:372)   
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)  
Caused by: java.lang.IllegalStateException: Can't start async operation 
(launchPurchaseFlow) because another async operation(refresh inventory) is in progress.      
at 
com.example.android.trivialdrivesample.util.IabHelper.flagStartAsync(IabHelper.java:812)   
at com.example.android.trivialdrivesample.util.IabHelper.launchPurchaseFlow(IabHelper.java:376)                                                                                       at com.example.android.trivialdrivesample.util.IabHelper.launchPurchaseFlow(IabHelper.java:341)                                                                                       at com.example.farshid.columnanalysis.MainActivity.gotoColumnAnalysis(MainActivity.java:186)                                                                                      at java.lang.reflect.Method.invoke(Native Method)                                                                                       at java.lang.reflect.Method.invoke(Method.java:372)                                                                                        at android.view.View$1.onClick(View.java:4010)                                                                                        at android.view.View.performClick(View.java:4764)                                                                                        at android.view.View$PerformClick.run(View.java:19844)                                                                                        at android.os.Handler.handleCallback(Handler.java:739)                                                                                        at android.os.Handler.dispatchMessage(Handler.java:95)                                                                                        at android.os.Looper.loop(Looper.java:135)                                                                                        at android.app.ActivityThread.main(ActivityThread.java:5376)                                                                                        at java.lang.reflect.Method.invoke(Native Method)                                                                                        at java.lang.reflect.Method.invoke(Method.java:372)                                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 

2 - 我有另一个问题:)当我购买我的应用程序时,如何更改我的按钮背景(例如将其测试从购买更改为阅读)

如何修复它们... tnx in advanced。

0 个答案:

没有答案