Skip to content

Commit 07304f5

Browse files
committed
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
1 parent 9d7bbcb commit 07304f5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/java/android/app/Activity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,11 +2540,10 @@ public boolean onMenuItemSelected(int featureId, MenuItem item) {
25402540
if (item.getItemId() == android.R.id.home && mActionBar != null &&
25412541
(mActionBar.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
25422542
if (mParent == null) {
2543-
onNavigateUp();
2543+
return onNavigateUp();
25442544
} else {
2545-
mParent.onNavigateUpFromChild(this);
2545+
return mParent.onNavigateUpFromChild(this);
25462546
}
2547-
return true;
25482547
}
25492548
return false;
25502549

0 commit comments

Comments
 (0)