How do I hide a menu item in the actionbar?
Get a MenuItem pointing to such item, call setVisible on it to adjust its visibility and then call invalidateOptionsMenu() on your activity so the ActionBar menu is adjusted accordingly. Update: A MenuItem is not a regular view that’s part of your layout. Its something special, completely different. Your code returns null for item and that’s … Read more