Androidのactivity startup mode

Source: Internet
Author: User

activity startup mode     . Concept    Activity startup mode defines the rules for activity initiation, which determines whether an activity's instance is created or reused   . Properties  The Activity's startup mode is set in the <activity> tab in Menifest.xml, and the property is Launchmode   . Classification  the activation mode of activity is divided into four categories: standard, Singletop, Singletask, singleinstance    . Remarks   Android uses task to manage different activity. When an activity is started, the system creates a task before starting the activity the entrance. We can understand the task as a stack.      . Standard (normal mode)   settings: System default mode, not set feature: Each time you create an activity, a new activity object will be created and pinned Example: Jump from activity A to activity B, then jump to Acticitya, the stack is: A, B , a      . Singletop (stack top singleton mode)   setting: Launchmode = "Singletop" Features: Check whether the top element of the stack is the current activity, if it is, reuse it, or, if not, create a new activity, pinned Example: The current stack is: A, B, C, the current stack top is C, if jump to C, then the C, the stack is: A, B, C    . Singletask (full stack singleton mode)   setting: Launchmode = "Singletask" Features: Check whether the full stack element has the current activity, if any, so that the activity above the activity out of the stack, so that it is pinned Example: The current stack is: A, B, C, D, if jump to B, then C, d out of the stack, the stack is: a-b    . SingleInstance (System singleton mode)   setting: Launchmode = "SingleInstance" Features: System-wide checks for the presence of the activity and, if present, multiplexing     from the above summary   same point: target activity must be pinned   different points: standard creates a new activity instance each time   Singletop/singletask first checks for the presence of the activity, and the presence is reused.   Singletop due to the top operation of the stack, do not need to be pinned; Singletask must be pinned   Singletop/singletask are implemented in-stack singleton   SingleInstance is the implementation of the system single case   singletask/singletop mode, all calls to Onnewintent ()                

Androidのactivity startup mode

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.