diff options
Diffstat (limited to 'java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsContextMenu.java | 7 | ||||
| -rw-r--r-- | java/org/gnu/emacs/EmacsView.java | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsContextMenu.java b/java/org/gnu/emacs/EmacsContextMenu.java index c5b87aa804a..c415ba59c79 100644 --- a/java/org/gnu/emacs/EmacsContextMenu.java +++ b/java/org/gnu/emacs/EmacsContextMenu.java @@ -347,6 +347,13 @@ public final class EmacsContextMenu Runnable runnable; final EmacsHolder<Boolean> rc; + /* Android will permanently cease to display any popup menus at + all if the list of menu items is empty. Prevent this by + promptly returning if there are no menu items. */ + + if (menuItems.isEmpty ()) + return false; + rc = new EmacsHolder<Boolean> (); rc.thing = false; diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java index 04c3d824027..0f83af882ae 100644 --- a/java/org/gnu/emacs/EmacsView.java +++ b/java/org/gnu/emacs/EmacsView.java @@ -622,6 +622,13 @@ public final class EmacsView extends ViewGroup if (popupActive && !force) return false; + /* Android will permanently cease to display any popup menus at + all if the list of menu items is empty. Prevent this by + promptly returning if there are no menu items. */ + + if (menu.menuItems.isEmpty ()) + return false; + contextMenu = menu; popupActive = true; |
