Returning null from a JNI method

6,637 views
Skip to first unread message

Olivier Guilyardi

unread,
Jul 8, 2010, 6:09:54 AM7/8/10
to andro...@googlegroups.com
Hi,

I have a JNI native function which returns a jobject. Under some circumstances
it needs to return a (Java) null value. How do I do that?

I couldn't find any doc about that, and I am unsure about returning (C) NULL
since this is what is used when an exception occur.

--
Olivier

fadden

unread,
Jul 8, 2010, 8:08:14 PM7/8/10
to android-ndk
JNI NULL is the same as C NULL (zero).

When a JNI function returns to the VM with an exception pending, the
return value is completely ignored.

Olivier Guilyardi

unread,
Jul 9, 2010, 5:08:42 AM7/9/10
to andro...@googlegroups.com

Okay, thanks!

--
Olivier

Reply all
Reply to author
Forward
0 new messages