Java – how to use a jobobject array? (JNI)
•
Java
Actually, I call a C function:
What I want to do is get the value of the original object Considering the Java code declaration of this object:
jniFct.testObject(new Object[][] { {"testTable"},{0,0.0,"aaa"},{1,1.1,"bbb"},{2,2.2,"ccc"} });
For example, get the value from the third row of the second column
Does anyone have an idea of how to do it?
Solution
jobject row = env->GetObjectArrayElement(objArray,2);
jobject row = env->GetObjectArrayElement(objArray,2); jobject value = env->GetObjectArrayElement((jobjectArray)row,1); const char* cvalue = env->GetStringUTFChars((jstring)value,0);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码