I build Android NDK application in Android Studio. I've subclassed NativeActivity
to add some Java code into my app. And I can't get this activity class with JNIEnv::FindClass
on the C++ side. I know that:
- I can call FindClass in Java thread only (I do so)
- I should use full
/
-separated path to my class (/com/my_package/MyActivity
) - The class should be public (not sure if it really should, but it is public, just in case)
Also, FindClass
for "built-in" classes, like android/net/Uri
, android/content/Intent
, etc works fine. I can call Java methods from C++ - all that works fine. However FindClass
for my own class doesn't work.
Googling for the similar errors didn't match my case. At least nothing helped from what I found. I work in Windows 7 (not sure if it matters).