加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cocos2dx android 爱贝支付平台接入记录

发布时间:2020-12-14 20:26:45 所属栏目:百科 来源:网络整理
导读:问题: 今天在接入爱贝支付平台的时候,出现一个错误: 01-2818:00:05.614:E/AndroidRuntime(25801):FATALEXCEPTION:GLThread5466 01-2818:00:05.614:E/AndroidRuntime(25801):java.lang.RuntimeException:Can'tcreatehandlerinsidethreadthathasnotcalledLo

问题:

今天在接入爱贝支付平台的时候,出现一个错误:

01-2818:00:05.614:E/AndroidRuntime(25801):FATALEXCEPTION:GLThread5466
01-2818:00:05.614:E/AndroidRuntime(25801):java.lang.RuntimeException:Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare()
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.os.Handler.<init>(Handler.java:121)
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.app.Dialog.<init>(Dialog.java:142)
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.app.AlertDialog.<init>(AlertDialog.java:114)
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.app.AlertDialog.<init>(AlertDialog.java:110)
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.app.ProgressDialog.<init>(ProgressDialog.java:96)
01-2818:00:05.614:E/AndroidRuntime(25801): atcom.iapppay.ui.widget.IPayLoadingDialog.<init>(UnknownSource)
01-2818:00:05.614:E/AndroidRuntime(25801): atcom.iapppay.sdk.main.SDKMain.showPrograssBar(UnknownSource)
01-2818:00:05.614:E/AndroidRuntime(25801): atcom.iapppay.sdk.main.SDKMain.begSession(UnknownSource)
01-2818:00:05.614:E/AndroidRuntime(25801): atcom.iapppay.sdk.main.SDKMain.onPreCallPayHub(UnknownSource)
01-2818:00:05.614:E/AndroidRuntime(25801): atcom.iapppay.sdk.main.IAppPay.startPay(UnknownSource)
01-2818:00:05.614:E/AndroidRuntime(25801): atcom.zssbd.zjd.IZhiAppPay.startPayhub(IZhiAppPay.java:39)
01-2818:00:05.614:E/AndroidRuntime(25801): atorg.cocos2dx.lib.Cocos2dxRenderer.nativeRender(NativeMethod)
01-2818:00:05.614:E/AndroidRuntime(25801): atorg.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame(Cocos2dxRenderer.java:94)
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
01-2818:00:05.614:E/AndroidRuntime(25801): atandroid.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

解决:
这是因为在cocos2dx opengl线程中调用android UI主线程的东西,解决方法:

new Handler(Looper.getMainLooper()).post(new Runnable() { @Override public void run() { } });

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读