3

I am trying to call a Java API that accepts ArraList of Strings from JNI

/*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");

But I am getting an error

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;

Is there any problem with the GetMethodID call that is having "(Ljava/lang/Object;)V" as first parameter for calling the Java API with parameter "ArrayList"

0

1 Answer 1

3

(Ljava/lang/Object;)V is the signature of a void method taking a single parameter of type java.lang.Object, you presumably need (Ljava/util/ArrayList;)V instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.