NewObject error for JNI inner class

Joined
Oct 28, 2010
Messages
4
Reaction score
0
I want to construct a new page object in jni, but it promoted '0x16 is not a valid JNI reference' when I use NewObject in jni native code, is there anything wrong?

public class parser {
class page {
int pageKind;
String Title;
String exTile;
String url;
labelBase[] label;
public page() {}
}
}


jclass page_class = env->FindClass("com/example/hellojni/parser$page");

jmethodID construct_page = env->GetMethodID(page_class,"<init>","(Lcom/example/hellojni/parser;)V");

jobject obj_Page = env->NewObject(page_class, construct_page);
 
Joined
Oct 28, 2010
Messages
4
Reaction score
0
As i know, A non-static inner class requires an instance of the surrounding
class, how could i construct the surrounding class in such situation?

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top