I using menu drawer which has more Fragments. In some Fragments I have menu item REFRESH but in some fragments I want hide this menu item (I don\'t
Fragment
Call setHasOptionMenu(true) in onCreateView()
setHasOptionMenu(true)
onCreateView()
and Do not call super.onCreateOptionsMenu() in fragment's onCreateOptionMenu() instead call menu.clear() because this will override the existing menu with the activity's menu
super.onCreateOptionsMenu()
onCreateOptionMenu()
menu.clear()
This worked in my case.