[java]代码库
public class Cocos2dxActivity extends NativeActivity{
.......
public static native void exitGame(); // 这里必须是native函数,因为要链接c++的实现
.......
}
extern "C"
{
JNIEXPORT void JNICALL Java_com_qmx_road2god_Cocos2dxActivity_exitGame(JNIEnv* env, jobject thiz)
{
Director::getInstance()->end();
pc_client_destroy(my_pomelo_client);
}
}
public class Cocos2dxActivity extends NativeActivity{
static { System.loadLibrary("cocos2dcpp"); } // 可以在这里调用
@Override
protected void onCreate(Bundle savedInstanceState)
{