OnPause used to move from one activity to another activity, device into hibernation (screen locked), or dialog Popup
OnStop for invisible Activity (when a dialog pops up, the activity underneath is still visible, so onStop is not called at this time)
The difference can be seen from the following log logs:
1. When jumping from firstactivity to secondactivity
Firstacvity---> OnCreate
Firstacvity--->onstart
Firstacvity--->onresume
Firstacvity--->onPause
Secondactivity--->oncreate
Secondactivity--->onstart
Secondactivity--->onresume
Firstacvity--->onStop
Now add the Android:theme= "@android: Style/theme.dialog" to the seconedactivity attribute in Androidmainfest.xml, The seconedactivity will appear as a dialog box and will not cover the Firstacvity form.
The status output at this point is:
Firstacvity---> OnCreate
Firstacvity--->onstart
Firstacvity--->onresume
Firstacvity--->onPause
Secondactivity--->oncreate
Secondactivity--->onstart
Secondactivity--->onresume
The OnStop method is called less firstacvity than when it is completely obscured.
The following two cases will only trigger onpause without triggering onstop
1. A transparent activity that contains dialog appears
2. Press Poweroff to lock the screen
Shows a non-activity dialog that is not called OnPause and OnStop, because this dialog belongs to the activity
Android-onpause ()