I have a main activity A. There are two scenarios
1) A launches B. B has launchmode singleTask and is launched with FLAG_ACTIVITY_NEW_TASK. now I have a menu option in B which performs a delete operation and starts the activity A.
2) A launches B, which launces C it also contains the menu option to perform delet opereation.
I want A to be started with clearing the stack in both the scenarios but the activities belonging to another task still present there I am stuck is there a way to clear the stack.