6

AFAIK, startActivityForResult was not working properly with launchMode singleInstance here. While recently, I find it works well on Android Lollipop(5.0) and can't find official document describing it. I think it's also related to tasks and back stack at the same time. Is there anyone can provide some information or explanation about it or anything about it?

Thanks:)

Community
  • 1
  • 1
Jerome
  • 1,749
  • 1
  • 14
  • 40

1 Answers1

4

https://stackoverflow.com/questions/8960072/onactivityresult-with-launchmode-singletask

this is a brief explain。

The answer shows in function startActivityUncheckedLocked of class ActivityStackSupervisor. Before Android 5.x, when starting an activity, it will check launchMode first and add FLAG_ACTIVITY_NEW_TASK to launchFlags if launchMode is singleTask or singleInstance. If the activity's launchFlags contains FLAG_ACTIVITY_NEW_TASK, it will send back a cancel immediately and let the new task continue launched as normal without a dependency on its originator.

Community
  • 1
  • 1
Honest
  • 182
  • 11