Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

Java调用JS出错

$
0
0

@heyuanchao 写道:

使用Java向JS传递一段字符串,并在界面上显示,报如下错误:
call to OpenGL ES API with no current context (logged once per thread)

Java代码:
AppActivity.getInstance().runOnGLThread(new Runnable() {
@Override
public void run() {
Cocos2dxJavascriptJavaBridge.evalString("cc.find('Canvas/background/btn_wx').getComponent('btn_wx').show('" + code + "', '" + state + "');");
}
});

Js代码:
show (code, state) {
cc.log('code: ' + code + ', state: ' + state);
this.label.string = code;
},

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>