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:)
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.
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