I am trying to hide the options menu when the Nav Drawer is opened. How do I do this? The hide()
doesn't work and I tried a few variations already..
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_write"
android:title="Write"
android:showAsAction="always"
/>
</menu>
public final class OptionsMenu{
private Menu menu;
public void onCreateOptionsMenu(MenuInflater inflater, Menu menu) {
inflater.inflate(R.menu.sample, menu);
this.menu = menu;
}
public boolean onMenuItemSelected(MenuItem item) {
switch (item.getItemId()) {
default:
return false;
}
}
public void hide(){
menu.findItem(R.id.menu_points).setVisible(false); //Doesn't work
}
}