Activity startup mode (Android: launchmode)

Source: Internet
Author: User

I recently studied several startup modes of activity, which are summarized as follows:

The four startup modes are as follows:

"Standard" (default)

"Singletop"

"Singletask"

"Singleinstance"

Standard is created every time, and each task can have multiple instances (each task can have multiple instances)
If the current singletop instance is at the top of the stack, the onnewintent of the instance will not be created. Create an instance if it is not on the top of the stack(Each task can have multiple tasks that can be reused at the top of the stack)
Singletask creates a new task. If another task already exists and contains the instance, the instance of the task is called directly. (Only one task exists)
Singleinstance creates a new task and has only one unique instance in the task. (Only one task exists, and only one task exists)

Set Through intent

Flag_activity_new_task is similar to singletask.
Flag_activity_single_top is similar to singletop
Flag_activity_clear_top clear


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.