diff options
author | Adam Powell <adamp@google.com> | 2012-07-18 18:20:29 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2012-07-19 11:24:47 -0700 |
commit | 0fc5b2bea09a6d320884c5b12577caf426f547c1 (patch) | |
tree | b6614d64033a577134faaf1fbdc8db40ef88a5d6 /core/java/android/app/Activity.java | |
parent | d2299ca8a28d1185d1dddd1d4832813484276c14 (diff) | |
download | frameworks_base-0fc5b2bea09a6d320884c5b12577caf426f547c1.zip frameworks_base-0fc5b2bea09a6d320884c5b12577caf426f547c1.tar.gz frameworks_base-0fc5b2bea09a6d320884c5b12577caf426f547c1.tar.bz2 |
Fun with Up navigation
For activities with a null taskAffinity, simply finish the current task.
(They probably shouldn't have specified a parentActivityName anyway.)
When launching into app info from ResolverActivity, launch the app info
page in the current task with FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET. Back
will return to the resolver, and Up will jump to Settings.
When launching into app info from RecentsPanelView or BaseStatusBar,
since this is a system affordance akin to notifications or widgets,
build the full task stack for the app info activity with
TaskStackBuilder and launch it as a new task.
Change-Id: I73b1941d0f52bd8b30382b5e17edd8ceb058c70d
Diffstat (limited to 'core/java/android/app/Activity.java')
-rw-r--r-- | core/java/android/app/Activity.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index f20fd33..809acac 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -2708,7 +2708,12 @@ public class Activity extends ContextThemeWrapper // metadata is available. Intent upIntent = getParentActivityIntent(); if (upIntent != null) { - if (shouldUpRecreateTask(upIntent)) { + if (mActivityInfo.taskAffinity == null) { + // Activities with a null affinity are special; they really shouldn't + // specify a parent activity intent in the first place. Just finish + // the current activity and call it a day. + finish(); + } else if (shouldUpRecreateTask(upIntent)) { TaskStackBuilder b = TaskStackBuilder.create(this); onCreateNavigateUpTaskStack(b); onPrepareNavigateUpTaskStack(b); |