Send MotionEvent from Java to JNI
问题 Is it possible to send MotionEvent from Java to C++ through JNI? I have a method in C++ that should receive a pointer to AInputEvent to send it to the Game class: JNIEXPORT void JNICALL Java_com_game_ActivityMain_onTouch(JNIEnv *jenv, jclass obj,jobject event) { AInputEvent* inputEvent=(AInputEvent*)event; game->OnInput(inputEvent); } }; in Java I declared the native method as: public static native void onTouch(MotionEvent event); but the application crashes when I tab on the screen. Edit: I