Issue
I'm getting app crash when i try to pass WCHAR_T* to java method.
I have WCHAR_T* variable and it length.
I down know how to cast it to jstring to call java method.
my c++ code :
bool test(WCHAR_T* document){
JNIEnv* jenv = getJniEnv();
methodID_test = jenv->GetMethodID(cc, "test", "(Ljava/lang/String;)Z");
return (bool)(jenv->CallBooleanMethod(obj,methodID_printDocument,document));
}
my java code :
public boolean test(String document) {
return false;
}
Solution
Use the NewString function to convert wchar_t to jstring.
jstring NewString(JNIEnv *env, const jchar *unicodeChars, jsize len);
Answered By - SolidMercury
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.