android - jni在getJavaVM之后获取JavaVm时候总是为NULL
PHPz
PHPz 2017-04-17 17:27:51
0
1
940

我调用java中的jni, 定义了一个变量:
static JavaVM *pMyJavaVm=NULL,

并且在函数中赋值:
env->GetJavaVM(&pMyJavaVm);

但是当我要用到 pMyJavaVm的时候 打印发现 值为NULL ,这是为什么呢?

PHPz
PHPz

学习是最好的投资!

reply all(1)
大家讲道理

The problem is solved, mainly due to the lack of thorough understanding of the C language. It is defined in a global header file, static JavaVM* pMyJavaVm; is included in several cpp files, and the variables in each file are independent, so Citing in other documents is problematic

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template