diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 521ad48a38..b45ee2d69b 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2291,16 +2291,18 @@ public class Launcher extends BaseDraggingActivity shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.all_apps_button_label), KeyEvent.KEYCODE_A, KeyEvent.META_CTRL_ON)); } - View currentFocus = getCurrentFocus(); - if (new CustomActionsPopup(this, currentFocus).canShow()) { - shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.custom_actions), - KeyEvent.KEYCODE_O, KeyEvent.META_CTRL_ON)); - } - if (currentFocus.getTag() instanceof ItemInfo - && DeepShortcutManager.supportsShortcuts((ItemInfo) currentFocus.getTag())) { - shortcutInfos.add(new KeyboardShortcutInfo( - getString(R.string.shortcuts_menu_with_notifications_description), - KeyEvent.KEYCODE_S, KeyEvent.META_CTRL_ON)); + final View currentFocus = getCurrentFocus(); + if (currentFocus != null) { + if (new CustomActionsPopup(this, currentFocus).canShow()) { + shortcutInfos.add(new KeyboardShortcutInfo(getString(R.string.custom_actions), + KeyEvent.KEYCODE_O, KeyEvent.META_CTRL_ON)); + } + if (currentFocus.getTag() instanceof ItemInfo + && DeepShortcutManager.supportsShortcuts((ItemInfo) currentFocus.getTag())) { + shortcutInfos.add(new KeyboardShortcutInfo( + getString(R.string.shortcuts_menu_with_notifications_description), + KeyEvent.KEYCODE_S, KeyEvent.META_CTRL_ON)); + } } if (!shortcutInfos.isEmpty()) { data.add(new KeyboardShortcutGroup(getString(R.string.home_screen), shortcutInfos));