I think it’s better to stop the child’s activity when in the background. for instance
Menu > Activity1 >
Now, if you go to menu again, then complete Acitivy 1 .
Again Menu > Activity 3 > Activity 2 > Menu
when you go to Activity 3, then Activity 2 .. then run Activity 2 of 3, using the initial activity for the result. SO, if you want to go to the menu from step 2. then you can go through Activity 3.
Another best solution is to use CLEAR_TOP , SINGLE_TASKS to open the menu. Therefore, when you go to the menu, only the activity of the menu is active. Then, causing termination, you can end your application.
source share