There are a few scenarios in which your activity is destroyed due to normal app behavior, such as when the user presses the Back button or your activity signals its own destruction by calling finish()
. The system may also destroy your activity if it's currently stopped and hasn't been used in a long time or the foreground activity requires more resources so the system must shut down background processes to recover memory.
By default, the system uses the Bundle instance state
to save information
about each View object in your activity layout (such as the text value entered into an EditText object). So, if your activity instance is destroyed and recreated, the state of the layout is restored to its previous state with no code required by you. However, your activity might have more state information that you'd like to restore, such as member variables that track the user's progress in the activity
.
u have to save those data in onSaveInstanceState(Bundle outState) and use onRestoreInstanceState(Bundle savedInstanceState)

http://developer.android.com/training/basics/activity-lifecycle/recreating.html