wp create menu programmatically code example
Example: setting navmenu programmatically
navigationView.getMenu().clear();
navigationView.inflateMenu(R.menu.menu_view);
navigationView.getMenu().clear();
navigationView.inflateMenu(R.menu.menu_view);