"Android-3" task stacks (tasks) in Android

Source: Internet
Author: User

One, Android task stack

Overview: The task stack in Android is actually a collection of activity, in the Android to exit the program must be all the activity in the task stack to clear the stack, this time to safely complete exit program,

Task stack destruction is the most secure state of the data, if not deleted, it is necessary to reasonably save the task stack, so that the task stack will retain the status of each activity, will also save the activity information,

The task stack is not necessarily unique, and there is more than one task stack in an activity, and in some cases, the activity can also have a single task stack (singleinstance).

Second, activity startup mode

1.STANDRD (Standard boot mode): This mode will recreate an activity instance each time the activity is started, adding it to the task stack, and not considering whether the instance exists in a task.

This will take the corresponding life cycle method for each instance created.

2.SingleTop (stack top multiplexing mode): each time the activity is started to determine the existence of the top of the stack, at the top of the stack is reused, not the top of the stack will still be recreated.

3.SingleTask (in-stack multiplexing mode): each time the activity is activated, it detects the presence of the activity in the entire task stack, which is placed on top of the stack and destroyed from the task stack by all activity.

4.SingleInstance: activity initiated in this mode will have a single task stack, and only one instance of it, with a single task stack. (this mode is seldom used)

"Android-3" task stacks (tasks) in Android

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.