Learn about the flag properties of intent with Android (36)

Source: Internet
Author: User

The following is a list of the flag properties that explain intent today:

    1. Flag_activity_brought_to_front
    2. Flag_activity_clear_top
    3. Flag_activity_new_task
    4. Flag_activity_no_animation
    5. Flag_activity_no_history
    6. Flag_activity_reorder_to_front
    7. Flag_activity_single_top
    • Start ACTIVITY in Flag_activity_brought_to_front mode

      If the current activity stack is as follows:

Then we start the activityb in the Activitya in Flag_activity_brought_to_front mode, when the ACTIVITY stack is as follows:

Summary: If you start Activityb in Flag_activity_brought_to_front mode, if the ACTIVITYB exists in the ACTIVITY stack, the next time you start the activityb again, The ACTIVITYB will be taken to the top of the stack.

    • Start ACTIVITY in flag_activity_clear_top mode

      If the current activity stack is as follows:

Then we start the ACTIVITYC in the Activitya in Flag_activity_clear_top mode, when the ACTIVITY stack is as follows:

Summary: If you start Activityc with Flag_activity_clear_top, the ACTIVITY (Activitya, activityb) above the activityc pops up.

    • Start ACTIVITY in Flag_activity_new_task mode

      If the current activity stack is as follows:

Then we start the ACTIVITYC in the Activitya in Flag_activity_new_task mode, when the ACTIVITY stack is as follows:

Summary: If you start Activityc with Flag_activity_new_task, the ACTIVITYC is recreated and placed on top of the stack, again, if you start the activity again in the same activity (b), At this point there will be two activity (B) in the stack.

    • Start ACTIVITY in flag_activity_no_animation mode

We then start the ACTIVITYC in flag_activity_no_animation mode in Activitya, which disables the transition animation when the ACTIVITYC is started.

    • Start ACTIVITY in flag_activity_no_history mode

If the current activity stack is as follows:

Then we start the Activitye in flag_activity_no_history mode in Activitya, and then start Activityf in Activitye, when the ACTIVITY stack is as follows:

Summary: If you start Activitye with Flag_activity_no_history and then start Activityf in Activitye, Activitye is not saved in the ACTIVITY stack.

    • Start ACTIVITY in Flag_activity_reorder_to_front mode

If the current activity stack is as follows:

If you start Activityb in Flag_activity_reorder_to_front mode, the ACTIVITY stack is as follows:

Summary: If you start activityb in a flag_activity_reorder_to_front manner, you will take activityb directly to the top of the stack.

    • Start ACTIVITY in flag_activity_single_top mode

      If the current activity stack is as follows:

Then we start Activitya again in Activitya, when the activity stack is:

Summary: If you start Activitya in flag_activity_single_top mode in Activitya, the ACTIVITY stack remains unchanged and Activitya is not recreated.

Reprint Please specify source: http://blog.csdn.net/hai_qing_xu_kong/article/details/45539333 Emotional Control _

Learn about the flag properties of intent with Android (36)

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.