The life cycle of the activity of the Reading notes of "Android Development Art exploration"

Source: Internet
Author: User

Activity life cycle in two different situations

(1) Life cycle in typical situations

Refers to changes in the life cycle of the activity as a result of the user's participation.

(2) life cycle in exceptional situations

The activity is destroyed and rebuilt by the system, or because the configuration of the current device is heavily changed.

See the activity life Cycle diagram for official documents

Note the following points:

(1) OnStart () and Onresume () from the actual use of the process is similar, but OnStart () when the activity is visible but still in the background, Onresume () when the activity has been shown in the foreground.

(2) OnStop () and OnPause () The difference is onpause () when the activity is also displayed in the foreground, OnStop () when the activity in the background is not visible.

(3) When a new activity is started, the old activity's OnPause () is executed first, and then the new activity is started, so do not do the heavyweight operation in the OnPause () method, as far as possible in the OnStop () process

Consider the activity with the project development:

(1)

The life cycle of the activity of the Reading notes of "Android Development Art exploration"

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.