

When the last Activity is removed from the back stack, then the Task terminates to the screen that was last running before the creation of the Task ( in our case the launcher screen). The Back button then keeps on popping the current Activities and restoring the previous activities.This destroys the Activity and the previous Activity resumes with its state restored. When the Back button is pressed then the current Activity is popped from the top of the back stack.The subsequent new Activities keep on piling the back stack.The system retains the current state of this Activity’s user interfaces like text in the form, scroll position etc. The previous Activity moves below this new Activity in the back stack and is stopped.When the current Activity starts another Activity, then the new Activity is pushed on top of the stack and takes focus.The application launcher creates a new Task with the main Activity created and placed in the root of the back stack ( It has another role that we will review later).We will now go through the default behavior of the Task and the Back Stack. The navigation of the back stack is done with the help of the Back button. The Activities in the Stack are never rearranged. The Stack has LIFO structure and stores the activities in the order of their opening. A Task is a collection of activities that user interact when performing a certain job.Ī Task holds the Activities, arranged in a Stack called Back Stack. Android defines the unit of a sequence of user interactions as Task. Let’s review the Android’s default implementations in the above regards. Android developer guide says: Each Activity should be designed around a specific kind of action the user can perform and can start other activities. The Android design already has taken a very good care of providing a smooth user experience in terms of managing the screen flows.

One of the most important aspects of achieving the above is to design a proper forward and backward navigations. This relation should be designed with the focus of developing an effortless and pattern forming strategy from the user’s perspective. The relation that each Activity holds with respect to other is very crucial for a good user experience. Android Activities are the logical construct of the screens that we want a user to navigate through.
