Are you complaining that Android will try to restore your application state gracefully after a crash ?;)
This is the result of Android resource management and the Activity lifecycle. Keep in mind that a single task can consist of several activities that can span multiple processes or applications. As stated here: http://android-developers.blogspot.com/2010/04/multitasking-android-way.html Android processes do not close "clean" in the traditional sense of the * nix process. Your application components receive life cycle events, but after a certain point, the application may be killed without further warning so that the system can recover its resources.
For example, a user can browse the web, click on the YouTube link that launches the YouTube application, then click the sharing button to launch his favorite social media application and post the video link. All of this is part of the same task; if the user clicks the button several times, they return to the page in the browser from which they started.
As soon as you launch the application for social networks, the system may decide that it is running on low memory, and it is going to kill the browser process to free up more. (In the end, this is not in front, and the user will not notice.) When the user clicks the "Back" button to return to browser activity, it restarts and restores the last state when the user left it. In the worst case, the user experiences a slight delay during reinitialization.
But the same sequence of events that restore the previous state of an Activity can occur even inside the same application in the same process. In your scenario, activity B is closed due to a failure. Thus, the system does what it always does - it returns to the previous operation: activity A. But activity. The process does not exist yet (it crashed!), Therefore the system restarts it and can restore its previous state.
adamp
source share