Override onPrepareOptionsMenu. Use MenuItem item =
menu.findItem(itemId) and then call item.setEnabled(false) to disable
it based on some condition.
From the docs for onPrepareOptionsMenu:-
Prepare the Screen's standard options menu to be displayed. This is
called right before the menu is shown,
hi,
based on your logic..
may u can try like this
menu.getItem(ItemID).setEnabled(false);
and if u dont want the item to be visible u cant set the visibility
accordingly..
On Mar 17, 5:03 am, David Toledo dtole...@gmail.com wrote:
Hi All
How to disable the menuitem in android
2 matches
Mail list logo