0

I'm following this guide to show my activity in Recent Screen like a separate task.
I've added this flag to open my activity in a new task:

newDocumentIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);

When I start an activity using startActivityForResut the new activity is not opened as a separate task.
However, if I start an activity using startActivity it is opening in a new task.
Is this is the default behavior? or am I missing something?

Xcodian Solangi
  • 2,342
  • 5
  • 24
  • 52
Vijay
  • 545
  • 1
  • 5
  • 15

1 Answers1

0

See the documentation for FLAG_ACTIVITY_NEW_TASK:

This flag can not be used when the caller is requesting a result from the activity being launched.

So I guess if you're asking for a result, android forces you to stay in the same task.

mbonnin
  • 6,893
  • 3
  • 39
  • 55