Below is the code I used to inflate a new menu file, all the layout files are ready, but I can not use the menu that was inflated by clicking on a menu item drawer it does not redirect to a new one I tried to do an expandableview in the menu, but there was a lot of content inside a menu, so I tried to make an expandableview as a menu, but it did not work, someone can help me with a good solution for this? this menu should appear on a separate screen, in fact the menu is already "working" with it inflating just does not respond to the click, anyway, is it possible to control this menu inflated inside drawer activity? (which had a file menu.xml replaced in this process, the famous submenu)
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.
int id = item.getItemId();
if (id == R.id.nav_home) {
beClosed(true);
HomeFragment homeFragment = new HomeFragment();
FragmentManager manager = getSupportFragmentManager();
manager.beginTransaction()
.replace(R.id.basic, homeFragment)
.commit();
return_home = false;
} else if (id == R.id.nav_funcoes) {
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.getMenu().clear();
navigationView.inflateMenu(R.menu.funcoes);
beClosed(false);
return_home = true;
}