(Android review) Task Stack and Startup Mode

Source: Internet
Author: User

(Android review) Task Stack and Startup Mode



This knowledge point is mainly understood as follows:

I. task stack)

1. function: it is used to manage the activity entry and exit. Records user behaviors.

2. Example:

Perform the following operations:


At this time, the activity in the task stack is as follows:





<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD48cD62/qGixvS2r8Sjyr08L3A + PHA + Environment + PHA + PGFjdGl2aXR5PGJyIC8 + Environment = "orientation | keyboardHidden">


2. Category:

Standard: Click an activity to create an activity.


SingleTop: if the activity to be started is already on the top of the stack, no new activity will be created.


SingleTask: if the activity to be started is already in the task stack, it will find the activity and
All the above activities are cleared and then reused.


SingleInstance: This activity occupies a separate job stack. When you start such an activity
The reference of this activity will cut off the previous reference


3. Example:


Note: Use A to represent MainActivity, and use B to represent Main2Activity.

1) if you perform operations A ----> B --->,

In this case, the result in the job stack corresponding to standard and singleTop is:




2) if A ------> B --------> A ------> B,

The job stacks corresponding to singleTask and singleInstance are as follows:












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.