Let us say I have 4 activities, A,B,C and D. Activity A starts B, B starts C using Intent. A button click in Activity C starts D. Clicking back button or closing Activity D should take me to Activity A. I have achieved this by starting Activity A with FLAG_ACTIVITY_CLEAR_TOP and FLAG_ACTIVITY_SINGLE_TOP flags from Activity C. onNewIntent in Activity A, I started Activity D so that clicking back or closing D will take to A.
I use entry and exit animation while starting and exiting the activities. For the above scenario, after the exit animation ends in Activity C I start Activity A. The problem here is since I start the activity after the animation I see the back stack ie, Activity B when Activity C animates down. I don't want to see Activity B in the back stack rather see Activity A. Not sure how to achieve this.
Is there any way to clear a part of the stack and then start a new activity?