Correct me if I'm wrong, but it should not call onCreate()
here's a gross over simplification, but let's say activity's are managed much like a simple stack, let's call it AppStack
When a onCreate()
for Activity A is called, the OS pushes the Activity Instance onto the AppStack
________ _________________
Activity|
___A____|_________________
When you click a button on Activity A, it launches a new intent to Activity B
Intent actB = new Intent(this, ActivityB.class);
and subsequently puts Activity A into Stopped
state
When Activity B's onCreate()
is called the OS pushes that Activity Instance onto the AppStack
________ __________________
Activity|Activity|
___A____|___B____|_________
Now if you call finish()
or super.onBackPressed()
in Activity B, the OS will pop()
the Activity from the AppStack
________ __________________
Activity|
___A____|__________________
When the OS returns to the previous activity, it sees that it is Stopped
and begins the process of Resuming it
through onResume()
.
Now if there is some data that you require to be persistent, you can add it in by Overriding onResume()
Check out the activity lifecycle docs, for more info:
