Android Add menu Divider using default DividerItemDecoration.


Example

Just use default DividerItemDecoration class :

NavigationView navigationView = (NavigationView) findViewById(R.id.navigation);
NavigationMenuView navMenuView = (NavigationMenuView) navigationView.getChildAt(0);
navMenuView.addItemDecoration(new DividerItemDecoration(context,DividerItemDecoration.VERTICAL));

Preview :

enter image description here