Bug 881507: NoSuchMethodError on MenuItem. [r=mfinkle]

This commit is contained in:
Sriram Ramasubramanian 2013-06-11 10:47:30 -07:00
parent c4b4956bc2
commit 81f9320373
2 changed files with 10 additions and 1 deletions

View File

@ -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)

View File

@ -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;