I have an Options Menu on my Activity
with an MenuItem
\"Start\". When this MenuItem
is selected I would like to alter the Menu so it
For this type of operation I usually choose not to alter the menu items, but just hide the ones you don't need:
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.start).setVisible(!isStarted);
menu.findItem(R.id.stop).setVisible(isStarted);
return true;
}