diff --git a/src/android/jar/src/org/qtproject/qt/android/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/QtNative.java index 81ef78a8e2c..33ffd58482f 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java @@ -348,6 +348,9 @@ public class QtNative static void startApplication(String params, String mainLib) { + if (m_stateDetails.isStarted) + return; + QtThread thread = getQtThread(); thread.run(() -> { final String qtParams = mainLib + " " + params; diff --git a/src/android/jar/src/org/qtproject/qt/android/QtView.java b/src/android/jar/src/org/qtproject/qt/android/QtView.java index babc766077e..55878209fed 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtView.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtView.java @@ -148,14 +148,14 @@ abstract class QtView extends ViewGroup { loader.setMainLibraryName(appLibName); QtLoader.LoadingResult result = loader.loadQtLibraries(); - if (result == QtLoader.LoadingResult.Succeeded) { - // Start Native Qt application - m_viewInterface.startQtApplication(loader.getApplicationParameters(), - loader.getMainLibraryPath()); - } else if (result == QtLoader.LoadingResult.Failed) { + if (result == QtLoader.LoadingResult.Failed) { // If we weren't able to load the libraries, remove the delegate from the factory // as it's holding a reference to the Context, and we don't want it leaked QtEmbeddedViewInterfaceFactory.remove(getContext()); + } else { + // Start Native Qt application + m_viewInterface.startQtApplication(loader.getApplicationParameters(), + loader.getMainLibraryPath()); } }