
以下代码应允许您访问字段 enrollmentID 。使用JNI
String函数来读取/ *** 作它们。
// Load the classjclass jclass_JCV = env->FindClass(env, "my.package.JC_VerificationCandidate");jfieldID fid_enrollmentID = env->GetFieldID(env, jclass_JCV, "enrollmentID" , "Ljava/lang/String;");// Access the first element in the jVerificationCandList array jobject jc_v = env->GetObjectArrayElement(env, jVerificationCandList, 0);// get reference to the string jstring jstr = (jstring) env->GetObjectField(env, jc_v, enrollmentID);// Convert jstring to native stringconst char *nativeString = env->GetStringUTFChars(env, jstr, 0);
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)