NavigationView sets the selected item as verified

I am using NavigationView from the support library. I have BaseActivity, action A and B from.

By default, the application starts at step A. When a user clicks on a box menu item, I start step B.

After the start of action B. how can I set the menu item corresponding to it to highlight, as noted?

Thanks in advance

UPDATE:

Now with the latest update in the support library, you can:

mDrawer.setCheckedItem(R.id.drawer_profile); 
+4
source share
1 answer

Use the following code:

 navigationView.getMenu().getItem(0).setChecked(true); 

Call this method after calling setNavDrawer ();

The getItem (int index) method gets MenuItem, after which you can call setChecked (true); on this MenuItem all you have to do is find out which index of the item the house has by default and replace it with that index.

+15
source

All Articles