1, do not set the activity of the android:configchanges, the screen will recall the various life cycle, cut across the screen will be executed once, cut the vertical screen will be executed twice
2, set the activity android:configchanges= "orientation", the screen will recall the various life cycle, cut horizontal, vertical screen will only be executed once
3, set the activity android:configchanges= "Orientation|keyboardhidden", the screen will not recall the various life cycle, will only execute onconfigurationchanged method
Summarize the life cycle of the activity
To add, the activity's life cycle will not change when the current activity generates an event that pops up toast and alertdialog
When the activity is running, press the home key (the same as when it is fully overwritten): Onsaveinstancestate---OnPause-onStop onrestart-->onstart--->onresu Me
Activity not being completely overwritten just loses focus: onPause--->onresume
Android Life cycle