Recognize Activity and create the first android app, activityandroid
Activity is the most basic core component of Android applications and a window for user-to-application interaction. In Android applications, an Activity usually corresponds to a separate view. An Android application is composed of one or more activities, which are equivalent to a webpage in a Web application, used to display information, and can jump between each other. Different from a webpage, an Activity jump can return a value.
2. Call the method in the activity process
Create --- onCreat () activation --- onStart () Recovery --- onResume () pause --- onPause () Stop --- onStop () destroy --- onDestroy () Restart --- onRestart ()
· OnCreat (Bundle savedInstanceState ). Called when an activity is created. This method also provides access to any previously stored status in the form of Bundle. The savedInstanceState object is used to save the status of the Activity object.
· OnStart (). Activity is called when it is visible to the user on the screen.
· OnResume (). Activity is called when it starts to interact with users (this method is always called whether it is to start or restart an Activity ).
· OnPause (). This method is called when the android system wants to activate other activities. It is called when the CPU and other resources are paused or withdrawn.
· OnStop (). Called when the activity is stopped and converted to an invisible stage.
· OnRestart (). It is called when a stopped activity is restarted.
· OnDestroy (). Called when the activity is completely removed from the system memory. This method may be called because someone directly calls the finish () method or the system decides to stop the activity to release resources.