summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2025-05-23 00:51:53 +0300
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2025-05-24 18:37:30 +0300
commit054dfb50a0c6b2bc9e2c227579eb6782e65e2134 (patch)
tree1240fac99518da7c7be7d58c447de03316d0904f
parent98120622ff1f6f87664f4c42e830000a21391751 (diff)
Android: avoid no impl found for updateNativeActivity() at startup
It seems that try/catch and ignoring the exception is not enough to silence the error message about no implementation found for the native method updateNativeActivity() when it's invoked at the start before the libraries are loaded. To fix that we can call it only if m_stateDetails.isStarted assuming that it would mean the libraries were loaded since the app has been started. Pick-to: 6.9 6.8 Change-Id: Ic23ce16439000090e2661b2e6956bcd9954bf33f Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtNative.java3
1 files changed, 2 insertions, 1 deletions
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 b6e17ce6636..bbb6487e899 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java
@@ -69,7 +69,8 @@ public class QtNative
synchronized (m_mainActivityMutex) {
m_activity = new WeakReference<>(qtMainActivity);
try {
- updateNativeActivity();
+ if (m_stateDetails.isStarted)
+ updateNativeActivity();
} catch (UnsatisfiedLinkError ignored) {
// No-op - this happens in certain e.g. QtQuick for Android cases when we set the
// Activity for the first time, before Qt native libraries have been loaded. The