diff --git a/mobile/android/base/menu/GeckoMenu.java b/mobile/android/base/menu/GeckoMenu.java index 6f27bcedac16..025e5bf9f591 100644 --- a/mobile/android/base/menu/GeckoMenu.java +++ b/mobile/android/base/menu/GeckoMenu.java @@ -244,7 +244,7 @@ public class GeckoMenu extends ListView if (menuItem.getItemId() == id) { return menuItem; } else if (menuItem.hasSubMenu()) { - if (menuItem.getActionProvider() == null) { + if (!menuItem.hasActionProvider()) { SubMenu subMenu = menuItem.getSubMenu(); MenuItem item = subMenu.findItem(id); if (item != null) diff --git a/mobile/android/base/menu/GeckoMenuItem.java b/mobile/android/base/menu/GeckoMenuItem.java index bac4ff19dfca..44d1e4b1992d 100644 --- a/mobile/android/base/menu/GeckoMenuItem.java +++ b/mobile/android/base/menu/GeckoMenuItem.java @@ -8,6 +8,7 @@ import org.mozilla.gecko.widget.GeckoActionProvider; import android.content.Intent; import android.graphics.drawable.Drawable; +import android.os.Build; import android.view.ActionProvider; import android.view.ContextMenu; import android.view.MenuItem; @@ -70,6 +71,14 @@ public class GeckoMenuItem implements MenuItem { return false; } + public boolean hasActionProvider() { + if (Build.VERSION.SDK_INT < 14) { + return false; + } + + return (mActionProvider != null); + } + @Override public ActionProvider getActionProvider() { return mActionProvider;