游戏中如何调用android 代码

yoyo
Sun, 19 Jun 2016 04:23:00 +0000

官方例子里：
onClick: function () {
var className = “org/cocos2dx/javascript/AppActivity”;
var methodName = “showAlertDialog”;
var methodSignature = “(Ljava/lang/String;Ljava/lang/String;)V”;
jsb.reflection.callStaticMethod(className, methodName, methodSignature, “Title”, “Native Call Test”);
}
可以调起安卓弹出框，我报jsb is not defined，是缺少什么吗？

阅读整个主题