我正在尝试调用从JNI接受字符串的ArraList的Java API
/*My Java Method that needs to be called from JNI*/
public void postArrayListOfStringsToJavaFromJNI(ArrayList<String> list)
{
}
//I am trying to create the methodId like below in JNI to call my Java API postArrayListOfStringsToJavaFromJNI
jmethodID method_id = env->GetMethodID(dmrcallbacks, "postArrayListOfStringsToJavaFromJNI", "(Ljava/lang/Object;)V");
但我收到错误
11-22 23:22:45.130: E/AndroidRuntime(19189): java.lang.NoSuchMethodError: no method with name='postArrayListOfStringsToJavaFromJNI' signature='(Ljava/lang/Object;)V' in class Lcom/example/JavaSample;
GetMethodID调用是否有“(Ljava / lang / Object;)V”作为调用带有参数“ArrayList”的Java API的第一个参数
答案 0 :(得分:2)
(Ljava/lang/Object;)V
是采用void
类型的单个参数的java.lang.Object
方法的签名,您可能需要(Ljava/util/ArrayList;)V
。