Flag attribute of Intent (Master of activity in stack position)

Source: Internet
Author: User
The flag attribute of intent can be used to control the arrangement position of the activity in the stack. This article lists common flags.
Flag_actmty_brought_to_front:

If the activity started by the flag already exists, the activity will only be taken forward when it is started again. For example, if activity A is in the existing activity stack, start Activity B with the flag (that is, Activity B is started with the flag_actmty_brought_to_front flag), and then start C and D in Activity B, if you start B again in Activity D, Activity B in the activity stack will be taken directly to the foreground. In this case, the activity stack is A, C, D, and B.


Flag_activity_clear_top:

This flag is equivalent to a singletask in the loading mode. The activity started with this flag will pop up all the activity stacks other than the activity to be started. For example, the activity stack contains activity A, B, C, and D. If the flag is used to jump from activityd to activityb, the activity stack only contains activity A and Activity B.


Flag_actmty_new_task:

The default startup flag, which controls the re-creation of a new activity.


Flag_activity_no_animation:

This flag controls that no transition animation is used when the activity is started.


Flag_activity_no_hlstory:

This flag controls that started activities will not be kept in the activity stack. For example, in the activity stack, there were originally three activities A, B, and C. In Activity C, Activity D is started with the flag, and activity D is started again, in this case, only activity A, B, C, and E are available. Activity D is not stored in the actvity stack.


Fiag_activity_reorder_to_front:

This flag controls the activity to be taken to the foreground directly if the activtity already exists. For example, the current activity stack contains four activities: A, B .C, and D. If the fiag_activity_reorder_to_front flag is used to start Activity B, in the started activity stack, the scenarios are a, c, d, and B.


Flag_activity_single_top:

The flag is equivalent to the singletop mode in the loading mode. For example, it is originally A, B, C, and D, in Activity D, the restart of Activity D is still a, B, c, and D.

Flag attribute of Intent (Master of activity in stack position)

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.