After you have thrown the exception you shouldn't call most of the JNI
methods (there are a few special methods that are still allowed to be
called). The error you see is because a JNI method was called while
there was already an exception raised.
05-19 13:48:16.932: WARN/dalvikvm(900): JNI WARNING: JNI method called
with exception raised
"Throwing" an exception in native code actually only sets an exception
in a pending state. Once the native code finishes and it returns to
java code this exception is actually thrown.
So after the ThrowNew() call it would be wisest to just return;
Any cleanup you might want to do should be done before you call the
ThrowNew method.
If above error occurs even though you don't call any JNI function
after the exception has been "thrown", then there's already an
exception pending from earlier code. There are methods in JNI that let
you unset a pending Exception so you can continue doing things (like
cleanup that needs JNI calls).
JNI documentation in the net should help with this.
e.g.:
http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html
-- Urs