The website life cycle chart is as follows:
A more common scenario is described below:
Two activity, a A and a B, these two activity all replicate the declaration cycle method and output the a/b+ life cycle function name in the method. A has a button to start B.
Scenario 1:
A starts with the button B in a:
A onCreate, a onStart, a onresume, a onPause , b onCreate, b onStart, b onresume-&G T A onStop -B ...
That is, when a starts B, when the A OnPause method executes, all of the initialization methods of B are executed, and a onstop executes after these methods of B are completed.
Scenario 2:
Case 1 is a condition in which B is opaque, a is not visible, then the same operation, if B is transparent such as in the form of a dialog box, and does not completely cover a, it is:
A onCreate, a onStart, a onresume, a onPause , b onCreate, b onStart b onStop- > B ondestory-a onresume , b onresume
In other words, when B is closed, b OnPause is performed first and then A is restored, because a does not stop, so the direct resume, the last B onStop, b Destroy.
Android Activity life cycle