Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

For the More Curious: Concurrent Documents


For the More Curious: Concurrent Documents


If you are running your apps on a Lollipop or later device, you may have noticed some interesting
behavior with respect to CriminalIntent and the overview screen. When you opt to send a crime report
from CriminalIntent, the activity for the app you select from the chooser is added to its own task rather
than to CriminalIntent’s task (Figure 24.15).


Figure 24.15  Gmail launched into separate task


On Lollipop forward, the implicit intent chooser creates a new, separate task for activities launched
with the android.intent.action.SEND or action.intent.action.SEND_MULTIPLE actions. (On
older versions of Android, this does not happen, so Gmail’s compose activity would have been added
directly to CriminalIntent’s task.)


This behavior uses a notion new in Lollipop called concurrent documents. Concurrent documents allow
any number of tasks to be dynamically created for an app at runtime. Prior to Lollipop, apps could only
have a predefined set of tasks, each of which had to be named in the manifest.

Free download pdf