Fixed the jni global reference

This commit is contained in:
shagrath 2011-11-09 23:57:44 +01:00
parent d1a7351c48
commit ddb4f6fcf7

View file

@ -251,7 +251,7 @@ Java_org_ab_x48_X48_registerClass( JNIEnv* env, jobject caller, jobject callback
{ {
LOGI("--registerClass--"); LOGI("--registerClass--");
android_env = env; android_env = env;
android_callback = callback; android_callback = (*android_env)->NewGlobalRef(env, callback);
jclass x48 = (*android_env)->GetObjectClass(env, android_callback); jclass x48 = (*android_env)->GetObjectClass(env, android_callback);
LOGI("--x48 registered--"); LOGI("--x48 registered--");
refreshMainScreen = (*android_env)->GetMethodID(android_env, x48, "refreshMainScreen", "([S)V"); refreshMainScreen = (*android_env)->GetMethodID(android_env, x48, "refreshMainScreen", "([S)V");