Android Screen component four startup modes for activity

Source: Internet
Author: User

First you need to understand the task stack:

The stack is advanced, the activity is in a different startup mode, and a completely different operation is taken each time he visits him.

1. Standard mode

Android:launchmode= "Standard"/>

Each access activity will create an instance of the stack

2, stack top mode--singletop

If an activity is accessed at the top of the stack, the activity does not instantiate the object again, but accesses an instance that already exists on the top of the stack, such as the stack top pattern set by an activity. When you go to the interface of his own to jump on the time will not instantiate an instance of their own.

3, Singletask

If you visit an activity that already has an instance on the stack, you will not generate an instance of the activity again, but instead access the instance that already exists on the stack and remove all the activity on the stack so that it is on top of the stack.

4. Single case Mode--singleinstance

For example, a browser, if a program opened the browser, another program to open the browser, it will jump to the browser interface has been opened, so as to avoid the waste of resources.

Related Article

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.