- 
    Bug 
- 
    Resolution: Duplicate
- 
     Not Evaluated Not Evaluated
- 
    None
- 
    6.8.3
- 
    None
- 
        
- 
        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
- Enable "Don't keep activities" in Developer Options
- Start my application, do something so I have some custom state to save.
- Switch away from app and back
- 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.
- duplicates
- 
                    QTBUG-131968 [Android] QtActivity fails to resume after restart -         
- Reported
 
-