There\'s a question for the same functionality on Blackberry, and a few different threads referred to this bug (which has since been closed without resolution as far as I ca
setEnabled(false)
works fine on API Level < 14
but on 14
the item still clickable.
On all android versions, easiest way to use this to SHOW a menu action icon as disabled AND make it FUNCTION as disabled as well:
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuItem item = menu.findItem(R.id.menu_my_item);
if (myItemShouldBeEnabled) {
item.setEnabled(true);
item.getIcon().setAlpha(255);
} else {
// disabled
item.setEnabled(false);
item.getIcon().setAlpha(130);
}
}