For calling java function's in Android Activity from JNI, I use the following code :
jmethodID messageMe = env->GetStaticMethodID(clazz, "updateStatus", "(IILjava/lang/String;)V");
env->CallStaticVoidMethod(clazz, messageMe);
it's working perfectly for Android 2.3 but not working for Android 4.0.3, I get this error message E/dalvikvm(9341): JNI ERROR (app bug): accessed stale global reference 0x5b6130b2 (index 19500 in a table of size 125)
so, how can i call correctly java function from jni for both new and old versions
Thanks