I'm very confused about FLAG_ACTIVITY_CLEAR_TASK in combination to FLAG_ACTIVITY_NEW_TASK. Isn't FLAG_ACTIVITY_CLEAR_TASK supposed to clear TARGET task but not caller task?
Let's assume I have this navigation
A -> B -> C
Where B calls C with FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TASK. How is that supposed to clear A and B from stack? I know that's happening because I tested it (If I click back on C, I leave the app), but I don't fully understand why... A and B are part of a different task that is not the task C will be created on.
FLAG_ACTIVITY_CLEAR_TASK
If set in an Intent passed to Context.startActivity(), this flag will cause any existing task that would be associated with the activity to be cleared before the activity is started.
Maybe text in bold above means that caller and target task are cleared. It's unclear to me what associated would be.