please explain it with the example I searched a lot but can understand Even I read this also https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_MULTIPLE_TASK
In short, it launches an activity into a new task that it creates. But to dig deeper, there are 2 things that you need to know:
FLAG_ACTIVITY_NEW_TASK
and start an activity as the calling activity, it will not create a new task, unless you have specified FLAG_ACTIVITY_MULTIPLE_TASK
as well.So,FLAG_ACTIVITY_MULTIPLE_TASK
basically depends on FLAG_ACTIVITY_NEW_TASK
- it has zero effect if you don't use both of them together. If you use both of these flags, every new instance of activity you launch will start individuals tasks.
Example: Say you have an application from where you want to redirect users to your application, published in the Google Play Store every time you push an update. For that, if you use both of these flags, the app will launch Google Play Store in an Intent as a separate task, enabling both the user to go back to the app & also keep the play store opened as well in a different screen. So you can accomplish both of these multiple tasks at the same time. Remove these two flags and you won't be able to accomplish the same.
Caution: Because the default system does not include graphical task management, you should not use this flag unless you provide some way for a user to return back to the tasks you have launched.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With