I have a very specific situation (required by a client) that has me having problems with the navigation, I gotta admit that I haven't handled Tasks
before this project, and I might be missing something a bit obvious.
Let's say I have activity A (main) that starts B. The thing is, a BroadcastReceiver
triggers an activity B (I know it's not recommended but it is one of the hard requirements) which needs to use FLAG_ACTIVITY_NEW_TASK
.
What happens is, I'm at the new B, and once the user enters a code, activity A will be prompted, if a press back there, I'll return to the original task if it was backgrounded, which has A->B. Leading to something like A->B->(background/home button). BroadcastReceiver->B->A->(back to old task of A->B)
Is there a way to get rid of that task or at least force the new activity A to be the one of the original stack so the user can go to the home screen once back is pressed?
I have checked this post but the suggestions didn't help.
Min API level 9.
Thank you in advance, and believe me, I've tried many launchMode combinations and read many many posts. Thank you once more.