[android-developers] Re: How to disable the menuitem

2010-03-17 Thread Nikhil Agarwal
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,

[android-developers] Re: How to disable the menuitem

2010-03-16 Thread grace
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