The app has MainActivity and NextActivity. User opens the app in MainActivity, then goes to NextActivity.
If user sent the app into background the system may kill the application process.
In logs I see that sometimes when user opens the app again next time the system restarts application process from NextActivity instead of MainActivity. Sometimes It causes one crash
I fixed the crash, but to test the fix I have to reproduce scenario when the application process is restarted from the last opened activity.
I checked and tried suggestions from this SOF questions:
Android Simulator: Easy way to simulate a process restart due to low memory?
Simulate killing of activity in emulator
Simulate low battery & low memory in Android
But every time when I kill the application process on next open I saw that the app restarted from MainActivity.