I want to enable and disable Context Menu, suppose in Context Menu Five Action is there and after selecting fifth action first action will disable and only enable when I select Fourth Action or doing some thing in other method of the application .
Suppose the code is:
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Option Menu");
menu.add(0, v.getId(), 0, "First Action");
menu.add(0, v.getId(), 0, "Second Action");
menu.add(0, v.getId(), 0, "Third Action");
menu.add(0, v.getId(), 0, "Fourth Action");
menu.add(0, v.getId(), 0, "Fifth Action");
}
now when I select First Action then this Action will disable and only enable when I select Fourth Action or done some calculation in other method of this application. Please Suggest me…
There is an inherited method
removeItem(int id)to remove an item from the context menu.