@@ -72,7 +72,7 @@ order in which each activity is opened.</p>
7272suppose you have a two-pane layout using fragments, one of which is a list view (fragment A) and the
7373other being a layout to display an item from the list (fragment B). When the user selects an item
7474from the list, fragment B is replaced by a new fragment (fragment C). In this case, it might be
75- desireable for the user to navigate back to reveal fragment B, using the BACK key .</p>
75+ desireable for the user to navigate back to reveal fragment B, using the BACK button .</p>
7676<p>In order to add fragment B to the back stack so that this is possible, you must call {@link
7777android.app.FragmentTransaction#addToBackStack addToBackStack()} before you {@link
7878android.app.FragmentTransaction#commit()} the transaction that replaces fragment B with fragment
@@ -93,40 +93,40 @@ is created and the "main" activity for that application opens as the root activi
9393<p>When the current activity starts another, the new activity is pushed on the top of the stack and
9494takes focus. The previous activity remains in the stack, but is stopped. When an activity
9595stops, the system retains the current state of its user interface. When the user presses the BACK
96- key , the current activity is popped from the top of the stack (the activity is destroyed) and the
96+ button , the current activity is popped from the top of the stack (the activity is destroyed) and the
9797previous activity resumes (the previous state of its UI is restored). Activities in the stack are
9898never rearranged, only pushed and popped from the stack—pushed onto the stack when started by
99- the current activity and popped off when the user leaves it using the BACK key . As such, the back
99+ the current activity and popped off when the user leaves it using the BACK button . As such, the back
100100stack operates as a "last in, first out" object structure. Figure 1 visualizes
101101this behavior with a timeline showing the progress between activities along with the current back
102102stack at each point in time.</p>
103103
104104<img src="{@docRoot}images/fundamentals/diagram_backstack.png" alt="" />
105105<p class="img-caption"><strong>Figure 1.</strong> A representation of how each new activity in a
106- task adds an item to the back stack. When the user presses the BACK key , the current activity is
106+ task adds an item to the back stack. When the user presses the BACK button , the current activity is
107107destroyed and the previous activity resumes.</p>
108108
109109
110110<p>If the user continues to press BACK, then each activity in the stack is popped off to reveal the
111111previous one, until the user returns to the Home screen (or to whichever activity was running when
112112the task began). When all activities are removed from the stack, the task no longer exists.</p>
113113
114- <div class="figure" style="width:369px ">
114+ <div class="figure" style="width:287px ">
115115<img src="{@docRoot}images/fundamentals/diagram_multitasking.png" alt="" /> <p
116- class="img-caption"><strong>Figure 2.</strong> Two tasks: Task A is in the background, waiting
117- to be resumed , while Task B receives user interaction in the foreground .</p>
116+ class="img-caption"><strong>Figure 2.</strong> Two tasks: Task B receives user interaction
117+ in the foreground , while Task A is in the background, waiting to be resumed .</p>
118118</div>
119- <div class="figure" style="width:178px ">
119+ <div class="figure" style="width:215px ">
120120 <img src="{@docRoot}images/fundamentals/diagram_multiple_instances.png" alt="" /> <p
121121class="img-caption"><strong>Figure 3.</strong> A single activity is instantiated multiple times.</p>
122122</div>
123123
124124<p>A task is a cohesive unit that can move to the "background" when users begin a new task or go
125- to the Home screen, via the HOME key . While in the background, all the activities in the task are
125+ to the Home screen, via the HOME button . While in the background, all the activities in the task are
126126stopped, but the back stack for the task remains intact—the task has simply lost focus while
127127another task takes place, as shown in figure 2. A task can then return to the "foreground" so users
128128can pick up where they left off. Suppose, for example, that the current task (Task A) has three
129- activities in its stack—two under the current activity. The user presses the HOME key , then
129+ activities in its stack—two under the current activity. The user presses the HOME button , then
130130starts a new application from the application launcher. When the Home screen appears, Task A goes
131131into the background. When the new application starts, the system starts a task for that application
132132(Task B) with its own stack of activities. After interacting with
@@ -135,7 +135,7 @@ started Task A. Now, Task A comes to the
135135foreground—all three activities in its stack are intact and the activity at the top of the
136136stack resumes. At
137137this point, the user can also switch back to Task B by going Home and selecting the application icon
138- that started that task (or by touching and holding the HOME key to reveal recent tasks and selecting
138+ that started that task (or by touching and holding the HOME button to reveal recent tasks and selecting
139139one). This is an example of multitasking on Android.</p>
140140
141141<p class="note"><strong>Note:</strong> Multiple tasks can be held in the background at once.
@@ -148,7 +148,7 @@ users to start a particular activity from more than one activity, a new instance
148148that activity is created and popped onto the stack (rather than bringing any previous instance of
149149the activity to the top). As such, one activity in your application might be instantiated multiple
150150times (even from different tasks), as shown in figure 3. As such, if the user navigates backward
151- using the BACK key , each instance of the activity is revealed in the order they were opened (each
151+ using the BACK button , each instance of the activity is revealed in the order they were opened (each
152152with their own UI state). However, you can modify this behavior if you do not want an activity to be
153153instantiated more than once. How to do so is discussed in the later section about <a
154154href="#ManagingTasks">Managing Tasks</a>.</p>
@@ -159,13 +159,13 @@ href="#ManagingTasks">Managing Tasks</a>.</p>
159159<ul>
160160 <li>When Activity A starts Activity B, Activity A is stopped, but the system retains its state
161161(such as scroll position and text entered into forms).
162- If the user presses the BACK key while in Activity B, Activity A resumes with its state
162+ If the user presses the BACK button while in Activity B, Activity A resumes with its state
163163restored.</li>
164- <li>When the user leaves a task by pressing the HOME key , the current activity is stopped and
164+ <li>When the user leaves a task by pressing the HOME button , the current activity is stopped and
165165its task goes into the background. The system retains the state of every activity in the task. If
166166the user later resumes the task by selecting the launcher icon that began the task, the task comes
167167to the foreground and resumes the activity at the top of the stack.</li>
168- <li>If the user presses the BACK key , the current activity is popped from the stack and
168+ <li>If the user presses the BACK button , the current activity is popped from the stack and
169169destroyed. The previous activity in the stack is resumed. When an activity is destroyed, the system
170170<em>does not</em> retain the activity's state.</li>
171171 <li>Activities can be instantiated multiple times, even from other tasks.</li>
@@ -247,7 +247,7 @@ flags to define how activities are associated with tasks and how the behave in t
247247<p class="caution"><strong>Caution:</strong> Most applications should not interrupt the default
248248behavior for activities and tasks. If you determine that it's necessary for your activity to modify
249249the default behaviors, use caution and be sure to test the usability of the activity during
250- launch and when navigating back to it from other activities and tasks with the BACK key . Be sure
250+ launch and when navigating back to it from other activities and tasks with the BACK button . Be sure
251251to test for navigation behaviors that might conflict with the user's expected behavior.</p>
252252
253253
@@ -311,8 +311,8 @@ android.app.Activity#onNewIntent onNewIntent()}, because it's at the top of the
311311stack remains A-B-C-D. However, if an intent arrives for an activity of type B, then a new
312312instance of B is added to the stack, even if its launch mode is {@code "singleTop"}.</p>
313313 <p class="note"><strong>Note:</strong> When a new instance of an activity is created,
314- the user can press the BACK key to return to the previous activity. But when an existing instance of
315- an activity handles a new intent, the user cannot press the BACK key to return to the state of
314+ the user can press the BACK button to return to the previous activity. But when an existing instance of
315+ an activity handles a new intent, the user cannot press the BACK button to return to the state of
316316the activity before the new intent arrived in {@link android.app.Activity#onNewIntent
317317onNewIntent()}.</p>
318318</dd>
@@ -324,7 +324,7 @@ intent to the existing instance through a call to its {@link
324324android.app.Activity#onNewIntent onNewIntent()} method, rather than creating a new instance. Only
325325one instance of the activity can exist at a time.
326326 <p class="note"><strong>Note:</strong> Although the activity starts in a new task, the
327- BACK key still returns the user to the previous activity.</p></dd>
327+ BACK button still returns the user to the previous activity.</p></dd>
328328<dt>{@code "singleInstance"}.</dt>
329329 <dd>Same as {@code "singleTask"}, except that the system doesn't launch any other activities into
330330the task holding the instance. The activity is always the single and only member of its task;
@@ -342,19 +342,17 @@ already has a task running in the background, that task is brought forward to ha
342342intent.</p>
343343
344344<p>Regardless of whether an activity starts in a new task or in the same task as the activity that
345- started it, the BACK key always takes the user to the previous activity. However, if you
346- start an activity from your task (Task A) that specifies the {@code singleTask} launch mode, then
347- that activity might have an instance in the background that belongs to a task with its own back
348- stack (Task B). In this
349- case, when Task B is brought forward to handle a new intent, the BACK key first navigates
350- backward through the activities in Task B before returning to
351- the top-most activity in Task A. Figure 4 visualizes this type of scenario.</p>
345+ started it, the BACK button always takes the user to the previous activity. However, if you
346+ start an activity that specifies the {@code singleTask} launch mode, then if an instance of
347+ that activity exists in a background task, that whole task is brought to the foreground. At this
348+ point, the back stack now includes all activities from the task brought forward, at the top of the
349+ stack. Figure 4 illustrates this type of scenario.</p>
352350
353351<img src="{@docRoot}images/fundamentals/diagram_backstack_singletask_multiactivity.png" alt="" />
354352<p class="img-caption"><strong>Figure 4.</strong> A representation of how an activity with
355353launch mode "singleTask" is added to the back stack. If the activity is already a part of a
356- background task with its own back stack (Task B) , then the entire back stack also comes
357- forward, on top of the current task (Task A) .</p>
354+ background task with its own back stack, then the entire back stack also comes
355+ forward, on top of the current task.</p>
358356
359357<p>For more information about using launch modes in the manifest file, see the
360358<code><a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a></code>
@@ -447,7 +445,7 @@ flag, the system looks for a different task to house the new activity. Often, it
447445However, it doesn't have to be. If there's already an existing task with the same affinity as the
448446new activity, the activity is launched into that task. If not, it begins a new task.</p>
449447
450- <p>If this flag causes an activity to begin a new task and the user presses the HOME key to leave
448+ <p>If this flag causes an activity to begin a new task and the user presses the HOME button to leave
451449it, there must be some way for the user to navigate back to the task. Some entities (such as the
452450notification manager) always start activities in an external task, never as part of their own, so
453451they always put {@code FLAG_ACTIVITY_NEW_TASK} in the intents they pass to {@link
@@ -549,9 +547,9 @@ android.content.Intent#ACTION_MAIN}
549547and a {@link android.content.Intent#CATEGORY_LAUNCHER}
550548filter. Imagine, for example, what could happen if the filter is missing: An intent launches a
551549{@code "singleTask"} activity, initiating a new task, and the user spends some time working in
552- that task. The user then presses the HOME key . The task is now sent to the background and not
553- visible. Because it is not represented in the application launcher, the user has no way to return to
554- the task .
550+ that task. The user then presses the HOME button . The task is now sent to the background and is
551+ not visible. Now the user has no way to return to the task, because it is not represented in the
552+ application launcher .
555553</p>
556554
557555<p>For those cases where you don't want the user to be able to return to an activity, set the
0 commit comments