cpp掉java非staitc方法 无参数 无返回值
1.头文件引入
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)#include <jni.h>#include "platform/android/jni/JniHelper.h"#include <android/log.h>#endif
?
2.按钮事件代码
调用非静态方法的关键代码
CallStaticVoidMethod
getMethodInfo
void HelloWorld::menuCloseCallback(CCObject* pSender) {JniMethodInfo minfo;bool isHave = JniHelper::getMethodInfo(minfo,"org/test/ActivityTest", "playVedio", "()V");if (isHave) {minfo.env->CallStaticVoidMethod(minfo.classID, minfo.methodID);}}
?
3.java非static方法
void playVedio(){System.out.println(" playVedio playVedio playVedio ");}
?
?
?
?
?
?
?