Add QtAndroidPrivate::context()
This simplifies the retrieval of the correct Context object. Task-number: QTBUG-55102 Change-Id: I303bc5393a7900ceb4bde36e711938f3f49075c1 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
parent
5dd907bf63
commit
958bc5793f
@ -357,6 +357,16 @@ jobject QtAndroidPrivate::service()
|
||||
return g_jService;
|
||||
}
|
||||
|
||||
jobject QtAndroidPrivate::context()
|
||||
{
|
||||
if (g_jActivity)
|
||||
return g_jActivity;
|
||||
if (g_jService)
|
||||
return g_jService;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
JavaVM *QtAndroidPrivate::javaVM()
|
||||
{
|
||||
return g_javaVM;
|
||||
|
@ -101,6 +101,7 @@ namespace QtAndroidPrivate
|
||||
|
||||
Q_CORE_EXPORT jobject activity();
|
||||
Q_CORE_EXPORT jobject service();
|
||||
Q_CORE_EXPORT jobject context();
|
||||
Q_CORE_EXPORT JavaVM *javaVM();
|
||||
Q_CORE_EXPORT jint initJNI(JavaVM *vm, JNIEnv *env);
|
||||
jobject classLoader();
|
||||
|
Loading…
x
Reference in New Issue
Block a user