3

我正在尝试调用一个接受来自 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;

将“(Ljava/lang/Object;)V”作为第一个参数用于使用参数“ArrayList”调用 Java API 的 GetMethodID 调用是否有任何问题

4

1 回答 1

3

(Ljava/lang/Object;)Vvoid是采用单个参数类型的方法的签名java.lang.Object,您可能需要(Ljava/util/ArrayList;)V

于 2012-11-22T18:17:17.393 回答