I have an ActionBar activity with a FrameLayout and a menu. when the user clicks the menu item I replace the fragment with the relevant new fragment. However, I cannot see a
First get the item you want to remove :
MenuItem item = menu.findItem(R.id.your_action);
then set it's Visibility false
:
item.setVisible(false);
and if the problem is in getting the menu (as it's not in the fragment), you can easily get a context
from the activity that contains the menu and get the menu by it.