The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Tasks

One of the most confusing aspects of Android to deal with is the concept of tasks. Fortunately, the automatic management of tasks is almost enough to get by, without you having to do much customization. However, some developers will need to tailor how their app interacts with the task system. Understanding what is possible and how to do it is not easy. It is made even more complicated by changes to Android, from both engineering and design perspectives, over the years.

This chapter will attempt to untie the knot of knowledge surrounding Android’s task system, explaining why things are the way they are. However, there will be a few places where the knot turns a bit Gordian, and we will have to settle for more about “how” and less about “why” the task system works as it does.

Prerequisites

Understanding this chapter requires that you have read the core chapters of this book.

One sample app makes heavy use of the PackageManager system service and refers in a few places to the Launchalot sample app profiled in that chapter.

First, Some Terminology

The preview of this section was fed to a gremlin, after midnight.

And Now, a Bit About Task Killers

The preview of this section is off trying to sweet-talk the Khaleesi into providing us with a dragon.

A Canary for the Task’s Coal Mine

The preview of this section was fed to a gremlin, after midnight.

The Default User Experience

The preview of this section is en route to Mars.

Explaining the Default Behavior

The preview of this section took that left turn at Albuquerque.

Basic Scenarios for Changing the Behavior

The preview of this section is en route to Mars.

Dealing with the Persistent Tasks

The preview of this section was lost in the sofa cushions.

Documents As Tasks

The preview of this section was lost in the sofa cushions.

Other Task-Related Activity Properties

The preview of this section was whisked away by a shark-infested tornado.

Other Task-Related Activity Methods

The preview of this section is in an invisible, microscopic font.