Android activity life cycle - what are all these methods for?
问题 What is the life cycle of an Android activity? Why are so many similar sounding methods ( onCreate() , onStart() , onResume() ) called during initialization, and so many others ( onPause() , onStop() , onDestroy() ) called at the end? When are these methods called, and how should they be used properly? 回答1: See it in Activity Lifecycle (at Android Developers). onCreate() : Called when the activity is first created. This is where you should do all of your normal static set up: create views,