I have a static Java function in an Activity. This function has int parameter. I want to call this function from JNI. I use below code to call, but I don't know how to pass int parameter:
In Java:
public static void updateTopScoreLeaderboard(int score) {
Log.i("", "updateTopScoreLeaderboard " + score);
}
In JNI:
if (JniHelper::getStaticMethodInfo(methodInfo, "com/nch/myApp/MyActivity", "updateTopScoreLeaderboard", "()V"))
{
methodInfo.env->CallStaticObjectMethod(methodInfo.classID, methodInfo.methodID);
}
methodInfo.env->DeleteLocalRef(methodInfo.classID);
That code work well if Java function has no param. But in this case (has int param), it not work.