Tasks and the Back Stack

Android uses tasks to keep track of the state within each running application. Each application opened from Android’s default launcher app gets its own task. This is the desired behavior – but, unfortunately for your NerdLauncher, it is not the default behavior. Before you foray into forcing applications to launch into their own tasks, let’s discuss what tasks are and how they work.

A task is a stack of activities that the user is concerned with. The activity at the bottom of the stack is called the base activity, and whatever activity is on top is the activity that the user sees. When you press the Back button, you are popping the top activity off the stack. If you are looking at the base activity and ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.