The activity life cycle of Android is picked from the internet
650) this.width=650; "style=" Float:none; "title=" 3g121-2.jpg "src=" http://s3.51cto.com/wyfs02/M01/28/01/ Wkiol1n1xqrckvzjaadbwrxgwza227.jpg "alt=" Wkiol1n1xqrckvzjaadbwrxgwza227.jpg "/>
Event callback method The following 1-4 cannot be terminated.
1. OnCreate (): The first method that is called after the activity is started, often used for initialization of activity, such as creating view, binding data, or recovering information.
(? What information OnCreate can recover)
2. OnStart (): When activity is displayed on the screen, the method is called
3. Onrestart (): The method is called when activity enters the active state from the stopped state.
4.onResume (): This method is called when activity is able to interact with the user and accept user input. The activity at this time is at the top of the activity stack
(? not understand )
5.onPause (): can be terminated. The method is called when activity enters a paused state. Typically used to save persistent data or to free up resource usage
6.onStop (): can be terminated. when activity enters a stopped state, the method is called
7.onDestory (): can be terminated. the method is called before the activity is terminated, i.e. before it goes into an inactive state.
8.onSaveInstanceState (): non-terminating. The Android system calls this method before terminating the activity due to insufficient resources to hold the activity's state information for onrestoreinstancestate () or oncreate () recovery
9.onRestoreInstanceState (): non-terminating. restores onsaveinstancestate () saved activity state information, called before OnStart () and Onresume ( )
650) this.width=650; "style=" Float:none; "title=" 3g121-3.jpg "src=" http://s3.51cto.com/wyfs02/M00/28/01/ Wkiom1n1xtxybiq0aacmzlm-t8g726.jpg "alt=" Wkiom1n1xtxybiq0aacmzlm-t8g726.jpg "/>