summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAndrew Solovay <asolovay@google.com>2014-07-21 17:53:30 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-21 17:53:30 +0000
commit6f4d82100388dbf22f2a6888004549bcb9efadf6 (patch)
treebc6bc5e1a509badd97f51068f41ddd98be106b90 /docs
parent122f599bb4ee0e4767a6a184973efe8e819790ca (diff)
parent30aa5924f0a372a10c7245a16ee460359826ab9c (diff)
downloadframeworks_base-6f4d82100388dbf22f2a6888004549bcb9efadf6.zip
frameworks_base-6f4d82100388dbf22f2a6888004549bcb9efadf6.tar.gz
frameworks_base-6f4d82100388dbf22f2a6888004549bcb9efadf6.tar.bz2
am 30aa5924: am 643fa8d1: Merge "docs: Noted how singleTop affects "up" navigation." into klp-modular-dev
* commit '30aa5924f0a372a10c7245a16ee460359826ab9c': docs: Noted how singleTop affects "up" navigation.
Diffstat (limited to 'docs')
-rw-r--r--docs/html/guide/topics/manifest/activity-element.jd18
-rw-r--r--docs/html/training/implementing-navigation/ancestral.jd21
2 files changed, 36 insertions, 3 deletions
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index c4d5083..f0e93b9 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -453,7 +453,7 @@ Similarly, a new instance of a "{@code singleTop}" activity may also be
created to handle a new intent. However, if the target task already has an
existing instance of the activity at the top of its stack, that instance
will receive the new intent (in an
-<code>{@link android.app.Activity#onNewIntent onNewIntent()}</code> call);
+{@link android.app.Activity#onNewIntent onNewIntent()} call);
a new instance is not created.
In other circumstances &mdash; for example, if an existing instance of the
"{@code singleTop}" activity is in the target task, but not at the top of
@@ -461,6 +461,22 @@ the stack, or if it's at the top of a stack, but not in the target task
&mdash; a new instance would be created and pushed on the stack.
</p>
+<p>Similarly, if you
+<a href="{@docRoot}training/implementing-navigation/ancestral.html">navigate
+up</a> to an activity on the current stack, the behavior is determined by the
+parent activity's launch mode. If the parent activity has launch mode {@code
+singleTop} (or the <code>up</code> intent contains {@link
+android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}), the parent is brought to the
+top of the stack, and its state is preserved. The navigation intent is received
+by the parent activity's {@link android.app.Activity#onNewIntent onNewIntent()}
+method. If the parent activity has launch mode {@code standard} (and the
+<code>up</code> intent does not contain {@link
+android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}), the current activity and its
+parent are both popped off the stack, and a new instance of the parent activity
+is created to receive the navigation intent.
+</p>
+
+
<p>
The "{@code singleTask}" and "{@code singleInstance}" modes also differ from
each other in only one respect: A "{@code singleTask}" activity allows other
diff --git a/docs/html/training/implementing-navigation/ancestral.jd b/docs/html/training/implementing-navigation/ancestral.jd
index 57251c1..8aa0fd6 100644
--- a/docs/html/training/implementing-navigation/ancestral.jd
+++ b/docs/html/training/implementing-navigation/ancestral.jd
@@ -133,7 +133,25 @@ android.support.v4.app.NavUtils} class's static method,
navigateUpFromSameTask()}. When you call this method, it finishes the current activity and
starts (or resumes) the appropriate parent activity.
If the target parent activity is in the task's back stack, it is brought
-forward as defined by {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}.</p>
+forward. The way it is brought forward depends on whether the parent activity
+is able to handle an {@link
+android.app.Activity#onNewIntent onNewIntent()} call:</p>
+
+<ul>
+ <li>If the parent activity has launch mode <a
+ href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+ &lt;singleTop>}</a>, or the <code>up</code> intent contains {@link
+ android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}, the parent activity is
+ brought to the top of the stack, and receives the intent through its
+ {@link android.app.Activity#onNewIntent onNewIntent()} method.</li>
+
+ <li>If the parent activity has launch mode <a
+ href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+ &lt;standard>}</a>, and the <code>up</code> intent does not contain
+ {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}, the parent activity
+ is popped off the stack, and a new instance of that activity is created on
+ top of the stack to receive the intent.</li>
+</ul>
<p>For example:</p>
@@ -157,7 +175,6 @@ activity was started in a task that belongs to a different app, then
navigating <em>Up</em> should create a new task that belongs to your app, which
requires that you create a new back stack.</p>
-
<h3 id="BuildBackStack">Navigate up with a new back stack</h3>
<p>If your activity provides any <a