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

Android app hangs on startup after OS process reclaim

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.8.3
    • GUI: Window management
    • None
    • Android
    • 2025wk34s2QtforAndroid

      My Android application hangs during startup after the OS has reclaimed the process in the background. We are integrating with the onSaveInstanceState lifecycle and that is causing problems. 

      Steps to Reproduce

      1. Enable "Don't keep activities" in Developer Options
      2. Start my application, do something so I have some custom state to save.
      3. Switch away from app and back
      4. Application hangs on splash screen

       

      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.

            assam Assam Boudjelthia
            akf4 Andrew K. Forrest
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes