4
The following I create a menu through the onCreateOptionsMenu method,.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.filter_menu, menu);
mMenu=menu
return true;
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
Menu id = navigationView.getMenu();
if (id.getItem(0) == item) {
//essa é a parte que eu tento deixar invisível mas ela não fica
mMenu.findItem(R.id.action_Filtro).setVisible(false);
}
}
The question is unclear. What are you testing with
id.getItem(0) == item
?– ramaral
is the following then is a layout Drawer Fragment,so when I open it I wanted to take an item from the menu that does not fit for this Fragment. @ramaral
– João Otavio