diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java index 83ed1582bf..9c7b57a4f5 100644 --- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java +++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java @@ -489,6 +489,14 @@ public class QtActivity extends Activity + "\tQML2_IMPORT_PATH=" + localPrefix + "/qml" + "\tQML_IMPORT_PATH=" + localPrefix + "/imports" + "\tQT_PLUGIN_PATH=" + localPrefix + "/plugins"); + + Intent intent = getIntent(); + if (intent != null) { + String parameters = intent.getStringExtra("applicationArguments"); + if (parameters != null) + loaderParams.putString(APPLICATION_PARAMETERS_KEY, parameters.replace(' ', '\t')); + } + loadApplication(loaderParams); return; } diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index b51c15c5d9..5c9ca798a8 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -419,14 +419,11 @@ static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobj static void *startMainMethod(void */*data*/) { - char const **params; - params = static_cast(malloc(m_applicationParams.length() * sizeof(char *))); + QVarLengthArray params(m_applicationParams.size()); for (int i = 0; i < m_applicationParams.size(); i++) params[i] = static_cast(m_applicationParams[i].constData()); - int ret = m_main(m_applicationParams.length(), const_cast(params)); - - free(params); + int ret = m_main(m_applicationParams.length(), const_cast(params.data())); Q_UNUSED(ret); if (m_mainLibraryHnd) {