- Clicking the back key of the device is equivalent to notifying the Android system "I have finished using the activity and I don't need it now." "After receiving the instruction, the system immediately destroys the activity. That is, call OnPause ()->onstop ()->ondestroy ()
- Click on the Home key, equivalent to notify Android "I'll take a look elsewhere and maybe come back later." "At this point, for a quick response to return to the app at any time, Android simply pauses the current activity without destroying it. Called OnPause ()->onstop (), but did not call OnDestroy ().
Note: There is no guarantee as to how long a stopped activity can be. If the system needs to reclaim memory, it will first destroy those stopped activity.
- When the device rotates, the currently seen activity instance is destroyed by the system and a new activity instance is created. namely OnPause ()->onstop ()->ondestroy ()->oncreate ()->onstart ()->onresume (). Because rotating the device will change the device configuration. A device configuration is a series of features used to describe the current state of a device. These features include: orientation of the screen, screen density, screen size, keyboard type, docking mode, language, and so on.
- Imagine a small pop-up window that partially obscures the current activity interface. When it appears, the masked activity is suspended by the system (OnPause ()) and the user cannot interact with it. When the small pop-up window is closed, the masked activity will start to run again.
Click the Android device back key, the home key, and how the rotation screen affects the activity's life cycle