On Apr 26, 5:56 am, Michal Seliga <
selmi....@gmail.com> wrote:
> Exception is I/dalvikvm( 612): Ljava/lang/
> CloneNotSupportedException;: Class doesn't implement Cloneable
This usually means that you tried to call a virtual method when you
wanted a static method. clone() appears early in the vtable.
> jmethodID cid = env->GetStaticMethodID(spdclass,"fromInt",
> "(I)Lpath/to/MyEnum;");
> if(cid != NULL)
> {
> jobject spd=env->CallObjectMethod(spdclass, cid, 1);
A jmethodID retrieved with GetStaticMethodID should only be used with
CallStaticObjectMethod. As of 2.3 ("gingerbread"), the CheckJNI
feature will detect this mistake automatically and complain.
Note that the return value from the CallMethod functions is undefined
when an exception is pending, so your test for NULL is insufficient.
You should always check for an exception (with e.g. ExceptionCheck)
before proceeding.