How to call a javascript function from a file gamescene.js inside AppActivity.java


#1

i tried running this, the build was successful but when i logged it there is no “JavaScript Java bridge!” found.

app.runOnGLThread(new Runnable() {
@Override
public void run() {
Cocos2dxJavascriptJavaBridge.evalString(“cc.log(“JavaScript Java bridge!”)”);
}
});

i also tried

Cocos2dxGLSurfaceView.getInstance().queueEvent(new Runnable() {
@Override
public void run() {
Cocos2dxJavascriptJavaBridge.evalString(“javaCallback()”);
}
});

but nothing seems to work, what may be the reason??

@Zinitter How to call Javascript function in Java with Cocos2d-JS?


#2

need help please anyone please give any ideas
@pandamicro @nite @chukong_usa @slackmoehrle


#3

I got it it was the problem with cocos2dx-3.13.1 i changed the n to 3.14 now its working fine