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

Commit b7de79d0 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 41bb82be: Merge "Fix NullpointException problem in onMenuItemSelected"

* commit '41bb82be':
  Fix NullpointException problem in onMenuItemSelected
parents 28a7a059 41bb82be
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2539,12 +2539,16 @@ public class Activity extends ContextThemeWrapper
     * Activity don't need to deal with feature codes.
     */
    public boolean onMenuItemSelected(int featureId, MenuItem item) {
        CharSequence titleCondensed = item.getTitleCondensed();

        switch (featureId) {
            case Window.FEATURE_OPTIONS_PANEL:
                // Put event logging here so it gets called even if subclass
                // doesn't call through to superclass's implmeentation of each
                // of these methods below
                EventLog.writeEvent(50000, 0, item.getTitleCondensed().toString());
                if(titleCondensed != null) {
                    EventLog.writeEvent(50000, 0, titleCondensed.toString());
                }
                if (onOptionsItemSelected(item)) {
                    return true;
                }
@@ -2562,7 +2566,9 @@ public class Activity extends ContextThemeWrapper
                return false;
                
            case Window.FEATURE_CONTEXT_MENU:
                EventLog.writeEvent(50000, 1, item.getTitleCondensed().toString());
                if(titleCondensed != null) {
                    EventLog.writeEvent(50000, 1, titleCondensed.toString());
                }
                if (onContextItemSelected(item)) {
                    return true;
                }