How to change the file menu being used in Android Menu Navigation Drawer?

1

I want to know if it is possible to change the menu file being used by the drawer navigation menu Example:Whenenteringthisifthatisinblue,itshouldbeselectedtouseanothermenufileinthedrawermenunavigation."Is that really possible?" - If yes, how to do it? -If not, is there a good solution for doing this?

    
asked by anonymous 02.02.2018 / 16:52

1 answer

0

It has a medium, but depending on what you intend to do I do not know if it would be usable because it also closes Navigation Drawer , but continuing ...

It is possible to change the file being used by Navigation Drawer , first you "clean" the menu that is being used with the method Clear() and then it inflates the new menu:

navView.getMenu().clear(); //limpa o menu inflado (e fecha o navigation drawer)
navView.inflateMenu(R.menu.menu_nav); //infla o novo menu

If this is not what you want, you can drill down a bit more than you need.

    
03.02.2018 / 19:22