I got a Java method that get a String
and returns boolean
.
I call it from JNI like this:
jmethodID function2ID = env->GetMethodID(
activityClass,
"MyFuncName",
"(Ljava/lang/String;)B");
if ( function2ID == null )
LOG("Could not find MyFuncName Function")
jboolean IsAutoPlay = env->CallBooleanMethod(
obj,
function2ID,
env->NewStringUTF(name));
I get Fatal Signal 11, Any idea what's wrong in the syntax?
My Java signature was to return Boolean
instead of boolean
.
Also
jmethodID function2ID = env->GetMethodID(
activityClass,
"MyFuncName",
"(Ljava/lang/String;)B");
needs to be Z
instead of B
.
jmethodID function2ID = env->GetMethodID(
activityClass,
"MyFuncName",
"(Ljava/lang/String;)Z");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With