summaryrefslogtreecommitdiff
path: root/src/plugins/platforms/android/androidjnimain.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-15 21:05:08 +0200
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2017-10-16 22:21:52 +0300
commit01afc8c810201b93a12fe7030344e03566d99001 (patch)
tree27727b38370209dc158856b4bb4d32ccd2e49fbe /src/plugins/platforms/android/androidjnimain.cpp
parenta090076e93487f8e461d9b866b9da1c0c21cb59b (diff)
parent49da5ce10034161017b261e000d4e9063d962401 (diff)
downloadqtbase-01afc8c810201b93a12fe7030344e03566d99001.tar.gz
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
Diffstat (limited to 'src/plugins/platforms/android/androidjnimain.cpp')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 8b0b18a846..2bdd49dc50 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -450,6 +450,17 @@ static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobj
static void *startMainMethod(void */*data*/)
{
+ {
+ JNIEnv* env = nullptr;
+ JavaVMAttachArgs args;
+ args.version = JNI_VERSION_1_6;
+ args.name = "QtMainThread";
+ args.group = NULL;
+ JavaVM *vm = QtAndroidPrivate::javaVM();
+ if (vm != 0)
+ vm->AttachCurrentThread(&env, &args);
+ }
+
QVarLengthArray<const char *> params(m_applicationParams.size());
for (int i = 0; i < m_applicationParams.size(); i++)
params[i] = static_cast<const char *>(m_applicationParams[i].constData());