From 07304f5299c6bccf84bd993239fbb3b87a0d46e6 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Mon, 7 May 2012 17:32:44 -0700 Subject: [PATCH] Fix a bug in Activity Up navigation dispatching Propagate the return value from onNavigateUp as the result of onMenuItemSelected. This fixes a bug where the action bar Up nav button clicks would not be propagated to support lib FragmentActivity or other activity subclasses that rely on processing otherwise unhandled onMenuItemSelected events. Change-Id: Id879dd1756ed06b8a7b720ebf0eae2a8ddc66ca8 --- core/java/android/app/Activity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 29d96feb790cc..781eea5011424 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -2540,11 +2540,10 @@ public class Activity extends ContextThemeWrapper if (item.getItemId() == android.R.id.home && mActionBar != null && (mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) { if (mParent == null) { - onNavigateUp(); + return onNavigateUp(); } else { - mParent.onNavigateUpFromChild(this); + return mParent.onNavigateUpFromChild(this); } - return true; } return false;