How can I alter a MenuItem on the Options Menu on Android?
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 contains a MenuItem "Stop". And finally when "Stop" is selected, I would like to alter back to "Start". Here is parts of my code that isn't working. I have both "Start" and "Stop" listed in mymenu.xml I should probably remove "stop" when the menu is created: public class MyActivity extends Activity { private boolean isStarted = false; @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); menu.removeItem(R.id.stop);