I would like to launch an activity (say abc) in a different task every time I launch the activity with flag_new_task.
How do i set a different affinity to the activity each time I launch it.
thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you set both the flags
Intent.FLAG_ACTIVITY_MULTIPLE_TASKandIntent.FLAG_ACTIVITY_NEW_TASKwhen launching the activity, then Android will create a new task every time you do it.BIG WARNING
HOWEVER, if you create many tasks like this using the same activity, there is no way for the user to return to a specific task by long-pressing on the HOME button. You need to make sure that you don’t confuse the user when you do this.
See
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_MULTIPLE_TASK