In Android application I have class MainClass
and in that class I have MainClass
which have public function Callback
which do some work.
public class MainClass {
public class TestClass {
TestClass( ) {
//
// Some code goes here.
//
}
public void Callback( ) {
//
// Do some work.
//
}
}
}
How I can call Callback
method from JNI, I use this way but my application crashes.
jclass cls = (*env)->FindClass( env, "com/application/Test/MainClass/TestClass" );
jmethodID mid = (*env)->GetMethodID( env, cls, "Callback", "()V" );
Try using GetObjectClass instead of FindClass