Last active
October 21, 2015 11:22
-
-
Save MaximAlien/55929e6bcad83bf1f98e to your computer and use it in GitHub Desktop.
[Android] [JNI] Assign value of the int array through JNI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int[] intVal = new int[1]; | |
JNIEXPORT jboolean JNICALL Java_com_test_example_ChIntVal_change_int(JNIEnv* env, jobject cls, jintArray intValArray) | |
{ | |
int testVal = -1; | |
jint *exTypeVal = env->GetIntArrayElements(intValArray, 0); | |
exTypeVal[0] = testVal; | |
env->ReleaseIntArrayElements(intValArray, exTypeVal, 0); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment