On Jul 12, 7:19 am, Elvis Dowson <
elvis.dow...@gmail.com> wrote:
> jint result = JNI_GetCreatedJavaVMs( &pjvmBuffer, jvmBufferLength,
> &jvmTotalNumberFound); // Get all created JavaVMs
That looks correct.
It's generally hard to go wrong caching a JavaVM, so long as you don't
keep using it after the VM goes away; since the VM doesn't go away
until the Android app is killed, you're safe. Where people often go
wrong is caching a JNIEnv and mistakenly using it from multiple
threads. (CheckJNI will catch that.)