Navigation Drawer item remains selected Android

I use

@Override
protected void onResume() {
    super.onResume();
    for (int i = 0; i < navigationView.getMenu().size(); i++) {
        navigationView.getMenu().getItem(i).setChecked(false);
    }
}

if did not work, also add:

itemOfMenu.setChecked(false);

to the end of onNavigationItemSelected override.


In addition to the above solutions, if group element in your drawer_view.xml file includes the below attribute,

android:checkableBehavior="single"

as shown in the below example :

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group android:checkableBehavior="single" > 
        <item
            ... />
        <item
          ... />
    </group>
</menu>

none of the above solution works. So be sure that you do not use that attribute if you do not want that highlight feature.