Recognize Activity and create the first android app, activityandroid

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.