"Android Beginner" 9, Activity life cycle

Source: Internet
Author: User

Start Android 1. How to define multiple activity in an application1) Define a class, inherit activity 2) In this class, the OnCreate method in the replication Activity 3) registers the activity in the Androidmainfest.xml file (all the controls in the Android program are Registry 2. Start an activity1) Generate an Intent object (Intent) 2) Call the SetClass method setting to start Activity 3) Call StartActivity method to start activity 3. Back Stack in AndroidUsed to record the user's process of opening an activity, which helps the program return to the previous activity correctly4. What is life cycle 5. Activity life cycle Function6. Call time of life cycle function 7. Status of Activity objectResumed:activity is in normal operation; Paused: Another activity is on the front, but this activity is still visible; Stopped: Another activity is in the front end, completely blocking the activity; 8. The Paired life cycle (actionbaractivity and activity)Androidbaractivity is a support library class can be compatible with the 2.x version of the activity provided by the Actionbar only over 3.0 can be used

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.