Activity Four startup modes and activity Four modes

Source: Internet
Author: User

Activity Four startup modes and activity Four modes

Four startup modes of Activity

In the process of project development, the jump of each Activity in the application will be involved. Some activities can be reused without repeated loading to save memory usage.

Modify the Startup Mode of the second Activity. You can set the launchMode attribute in the AndroidManifest. xml file of the function list.


1). the starndard standard job stack mode is arranged in one-to-one mode (default startup mode)


2). singleTop
If this mode is set on the interface to be enabled, first check whether it is at the top of the task stack. If it is already at the top, reuse the current top, no longer create a new one that is not at the top, and then create a new

Application instance:

Browser bookmarks
To save memory
 

3). singleTask

If the activated Activity is already in the task stack, all the activities above it will be killed when you enable it again, and you will not be able to create a new Activity.

Application instance:

Browser BrowserActivity

 
4). singleInstance
If this method is used, the activated Activity is placed in a task stack separately, and only such an instance exists in the task stack.
If an interface is a public interface, any interface can be opened.

Application instance:

Laiphone' Interface
Kingsoft

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.