Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
6.7.0
-
-
6d2db42f7 (dev), aef9fff1d (dev), d8570cb1a (6.8)
Description
If the embedding Activity is recreated, for example due to orientation change, resources don't seem to be properly cleared up, leading to a crash after enough recreations have happened.
When the Activity is recreated, for example due to not-overridden orientation change, the app gets stuck.
Before https://codereview.qt-project.org/c/qt/qtbase/+/557217 whenever the Activity got destroyed, we also called system.exit(), hence quitting the whole app, and it just got restarted with the new Activity, making it look like it worked, for a while. However, removing the system.exit() call lead to other issues, like the QtThread instance already being stopped.
Steps to reproduce:
Remove the line android:configChanges="orientation|screenLayout|screenSize" from the example's (qtquickview_java or another embedded QML example) AndroidManifest.xmlstart the exampleswitch the orientation of the emulator/device
Updated steps to reproduce now that the Activity does not get recreated when switching orientation:
- Have an Android app that has a QtQuickView (one of the examples is fine)
- To the Activity of that app, add a button and set its click handler:
// Add the Button in the XML layout with ID "button", add the following to Activity's onCreate(): Button button = findViewById(R.id.button); button.setOnClickListener(view -> finish()));
- Click the button to finish/destroy the Activity
- Restart the Activity normally, i.e. clicking the icon on the launcher
Attachments
Issue Links
- blocks
-
QTBUG-125145 Starting a new Activity with embedded QML crashes when one already exists
- Reported
- is blocked by
-
QTBUG-124114 QtLoader: only try to load the libraries once
- Closed
- is required for
-
QTBUG-125088 Embedded QML and Qt Quick for Android on Qt 6.9
- Open
-
QTBUG-125086 Embedded QML and Qt content as Android View work for Qt 6.8
- Closed
-
QTBUG-117649 Embed 2..N QML views in Activity
- In Progress
- resulted from
-
QTBUG-123306 Orientation issues with embedding QML to Android Java application
- Closed