Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-131968

[Android] QtActivity fails to resume after restart

XMLWordPrintable

    • Android
    • 2025Season1QtforAndroid

      1. In Developer Options enable Don't keep activities.
      2. Deploy an app to the device. E.g. Same Game from the Qt examples.
      3. Start the app.
      4. Press the Home button and the Android system should destroy the activity. Next, after 2-3 seconds, return to the app. Repeat this several times and you will notice that the app will no longer restart. Sometimes it fails on the first try.

      This bug might be related to QTBUG-126279 and QTBUG-124786 .

       

      More context from QTBUG-138906:

      We can reproduce this 100% of the time using the developer option, and in normal use this happens when the app is backgrounded on a busy device or for a long time, which for us happens a lot due to our customers workflows. It looks like on restart, the main() bit of the C++ side is not invoked. It looks like overriding onRestoreInstanceState in java and removing "Started" from the bundle might help but I don't know enough about the full picture of Qt lifecycle on Android to know if it is the right/wrong thing to be playing with. It looks to me like this is added in to the bundle for some of the lifecycle management where state is saved and then restored but without the process dying. When we force the other situation this flag clearly is wrong, as the process has died and needs rebuilding from scratch, then having the app state restored.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtandroidteam Qt Android Team
            adrian.gabureanu Adrian Gabureanu
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes