Android task and rollback stack-start task

Source: Internet
Author: User

You can use "android. intent. action. main and Android. intent. category. launcher respectively specifies the action and category for the intent filter to create an activity as the entry to a task. For example:

<Activity...>
<Intent-filter...>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category Android: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
...
</Activity>

This kind of intent will display the icons and labels of the corresponding activity in the application launcher, provide users with a method to start this activity and return the task it created (Anytime after it is started.

Second, it can be important that the user must be able to leave a task and return the task using the initiator of the activity. For this reason, there are two startup modes for marking activity as the entry to start a task: singletask and singleinstance. They should only be used when the activity has the action_main and category_launcher filters. For example, imagine what would happen if this filter is missing: an intent starts an activity marked with singletask and initializes a new task, the user has spent some time in this task. Then, the user presses the Home button and the task is transferred to the background and no longer displayed. Now, because no icon is displayed in the application launcher, you cannot return to this task.

Related Article

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.