@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