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>
This commit is contained in:
Assam Boudjelthia 2025-05-23 00:51:53 +03:00
parent 98120622ff
commit 054dfb50a0

View File

@ -69,6 +69,7 @@ public class QtNative
synchronized (m_mainActivityMutex) {
m_activity = new WeakReference<>(qtMainActivity);
try {
if (m_stateDetails.isStarted)
updateNativeActivity();
} catch (UnsatisfiedLinkError ignored) {
// No-op - this happens in certain e.g. QtQuick for Android cases when we set the