Android activity status, lifetime, startup mode

Source: Internet
Author: User

Activity Status:
1. Operation Status
2. Suspend status
3. Stop state
4. Destruction Status

Lifetime of activity

Seven Callback methods
1, OnCreate ()
2, OnStart ()
3, Onresume ()
4, OnPause ()
5, OnStop ()
6, OnDestroy ()
7, Onrestart ()

Three lifetimes:
1. Full lifetime: OnCreate () and Ondestory ()
2. Visible lifetime: OnStart () and OnStop ()
3. Foreground survival time: Onresume () and OnPause ()

Active startup mode:

1, Standard: Click on any activity will re-create the activity

2, Singletop: When clicked to start the top of the stack activity, will not create a new activity, but if the activity is not at the top of the stack, it will be recreated

3. Singletask: If the activity has already been created, the restart will not be created

4, SingleInstance: Solve the problem of sharing activities

Android activity status, lifetime, startup mode

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.