You can write a simple function that takes a jobjectArray
object, cast each one to jstring and then call GetStringUTFChars
on it.
Like this:
void MyJNIFunction(JNIEnv *env, jobject object, jobjectArray stringArray) {
int stringCount = env->GetArrayLength(stringArray);
for (int i=0; i<stringCount; i++) {
jstring string = (jstring) (env->GetObjectArrayElement(stringArray, i));
const char *rawString = env->GetStringUTFChars(string, 0);
// Don't forget to call `ReleaseStringUTFChars` when you're done.
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…