Android Activity startup mode

Source: Internet
Author: User

Han Mengfei sha Han Yafei [email protected] yue31313 Han_meng_fei_sha

1, Standard,

2, Single Top

3, single task

4, single Instance

The standard is that every time this activity is started, a new active object is created in the stack.

What is a stack, the stack is advanced after a data structure.

The storage of the active object is stored by the stack structure.

A single top is every time you start this activity, and if the last one inside the stack is already the activity, just let it show up, if not, create it.

The top of the stack is the last place to enter.

Is the top of the stack the first element to begin with, or the last element to enter?

When an activity is not created, it is called at the time of the new intent onnewintent this method.

A single task is to start this activity every time, to ensure that there is only one active object in the stack structure, and that the active object, if it is present in the stack, will remove all the back and let it appear.

A single instance, which is each startup and this activity, guarantees that this activity is only in one task stack alone.

There are many task stacks.   The previous three stacks are a single task stack. The application first has a stack, which holds the task. The task stack is then stocked with activities.

Android Activity 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.