The behaviour Im seeing is:
If you use "dont keep activities" the memory of the activity will always be destroyed and it will be recreated from scratch with the data from the Intent
and savedBundle
everytime the activity comes back from the background. This helps to test android lifecycle issues.
But what else may happen in reality: if the app is in the background for long the android.app.Application
object itself will be destroyed/collected while simultaneously keeping the stack information of the activities. Android will then try to recreate the activity with the data from the Intent
and savedBundle
, but also recreates the android.app.Application
object.
So the question: Is there a way to simulate this behaviour?
EDIT: later found this also answered here: How to simulate Android killing my process