About the Android activity life cycle

Source: Internet
Author: User

7 methods constitute a life cycle of Android activity, summed up in the following key points:

1, when starting an activity, will execute OnCreate (), OnStart (), Onresume () three methods

2. When a dialog window pops up, the activity loses focus, the OnPause () method is executed, and the dialog is executed Onresume () method

3, when the home button to cut out, activity is not visible but not destroyed (commonly known as no Finish () off), will execute OnPause (), OnStop () method, cut back will execute Onrestart (), OnStart (), Onresume ( ) Three methods, so sometimes in the implementation of some input operations to consider the user will be cut out, so you need to save the user input information in the OnPause () method, and then in the Onrestart () method to remove

About the Android activity life cycle

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.