I\'ve got 4 activities say Act1, Act2, Act3 and Act4.
A button in Act1 opens Act2, a button in Act2 opens Act3, a button in A
The approach I use is to start all child activities with startActivityForResult. Then I can putExtra("STATE", some_value) on exiting any child and use the state value to determine what to do up through the parents.
If I want to exit the app from a deep child, "STATE" would be "exit" and each child in the hierarchy would simply get the StringExtra for "exit", do a putExtra("STATE", "exit") and call finish() and then the app would call finish() in the end. You can use this to achieve any desired state.
Using startActivityForResult to pass messages this way avoids having to pass awkward references down into the child activities and simplifies your approach to setting the desired state of the app.