Tasks

A task is the sequence of activities the user follows to accomplish an objective, regardless of which applications the activities belong to. Until a new task is explicitly specified (see "Interrupting the Task"), all activities the user starts are considered to be part of the current task. It's notable that these activities can be in any application — that is, all in the same application or in different ones. That is, a task that starts out in contacts can continue, by choosing an email address, to an email activity and then, by attaching a file, to a picture gallery to pick from. Contacts, email and picture gallery are all separate applications.

The activity that starts a task is called the root activity. It is often, but not necessarily, started from the application launcher, Home screen shortcut or "Recent tasks" switcher (a long press on Home on some devices). The user can return to a task by choosing the icon for its root activity the same way they started the task. Once inside a task, the BACK key goes to previous activities in that task. The activity stack is made up of one or more tasks.

Here are some examples of tasks:

• Send a text message with an attachment

• View a YouTube video and share it by email with someone else

Interrupting the Task - An important property of a task is that the user can interrupt what they're doing (their task) to perform a different task, then are able to return to where they left off to complete the original task. The idea is that users can run multiple tasks simultaneously and switch between them. There are two primary ways to jump off to that other task — in both cases the user should be able to return to where they were before the interruption:

• User is interrupted by a notification - a notification appears and the user wants to act on it

• User deciding to perform another task - user just presses Home and starts an application

Of course, there are exceptions to the rules. Beyond the two ways just mentioned, there is a third way to start a task, and that is by starting an activity that defines itself as a new task. Maps and Browser are two applications that do this. For example, choosing an address in an email starts

• Calendar - activities to view day, view week, view month, view agenda, edit an event, edit preferences, and view an alert

• Camera - activities for running the camera, viewing the list of pictures, viewing a picture, cropping a picture, running the camcorder, viewing the list of movies, and viewing a movie

• Game - one activity to play the game, typically another for setup

• Maps - one activity to view a location on a map, a second for lists (such as turn list or friend list), and a third for details (friend location, status, photo)

An activity is the most prominent of four components of an application. The other components are service, content provider and broadcast receiver. For more details on activities, see Activity inApplication Components.

0 0

Post a comment