Enable new tasks in Android

Source: Internet
Author: User

Read "tasks and back stack" on the official website today, and follow the instructions in intent. flag_activity_new_task or androidmanifest. XML settings for Android: launchmode = "singletask": no new task can be created. Check it online.


each activity has the taskaffinity attribute, which indicates the task it wants to enter. If a

If the activity does not explicitly specify the taskaffinity of the activity, its attribute is equal to the taskaffinity specified by the application, if the application is not specified,

the value of taskaffinity is equal to the package name. Task also has its own affinity attribute, whose value is equal to its root

the taskaffinity value of the activity. If you do not assign an affinity to a task, it cannot be created. (I guess this is the reason) The allowtaskreparenting attribute of the activity is true by default and enters the background, when a task with the same affinity as it enters the foreground, it reselect the host and enters the foreground task. So I guess that's why Google won't allow you to create a new task without assigning kinship.

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.