JNI on Android, how to pass int from c to java
- by Joaquin
I have a C function, I simply returns an integer, as follows:
JNIEXPORT jint JNICALL Java_org_project_ScreenPosition(JNIEnv* env, jobject thiz){
int i=1;
return i;
}
I call this function in the way of an Activity onCreateContextMenu Android, as follows:
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){
menu.setHeaderTitle("TryMenu");
int a=ScreenPosition();
return;
}
But all crash