Introduction of three activity modules [onSavedInstanceState()] [onPause()] [onResume()]
onSaveInstanceState()
is called by Android if the Activity is being stopped and may be killed before it is resumed! This means it should store any state necessary to re-initialize to the same condition when the Activity is restarted. It is the counterpart to the onCreate()` method, and in fact the `savedInstanceState` Bundle passed in to `onCreate()` is the same Bundle that you construct as `outState` in the `onSaveInstanceState()
method.
onPause()
and onResume()` are also complimentary methods.
onPause()is always called when the Activity ends, even if we instigated that (with a
finish()call for example). We will use this to save the current note back to the database. Good practice is to release any resources that can be released during an
onPause()as well, to take up less resources when in the passive state.
onResume()will call our ```populateFields()
method to read the note out of the database again and populate the fields.
Comments
populateField() function is used to assign values to EditText controls.you can see more details about it from reference link.
Reference: http://code.google.com/android/intro/tutorial-ex3.html
转载于//www.cnblogs.com/EdgarSun/archive/2009/01/09/1372725.html
还没有评论,来说两句吧...