Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07304f52 authored by Adam Powell's avatar Adam Powell
Browse files

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
parent 9d7bbcb8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;