title: How to set shared checkable behavior across all groups in NavigationView?
body: <p>I've created two groups with unique ids (I need a divider) and they both have <code>checkableBehavior</code> set to <em>single</em>. This allows multiple items from different groups to be checked at once, and that's exactly what I'm trying to avoid. I'd like to have one item checked at maximum, across all groups.</p>
  
  <p>Since I haven't found any way to do this in XML, I tried to implement a simple logic in <code>onNavigationItemSelected</code> to uncheck the previous menu item:</p>
  
  <pre><code>if (previousItem != null)
     previousItem.setChecked(false);
  currentItem.setChecked(true);
  </code></pre>
  
  <p>but <code>setChecked(false)</code> method has never worked for me - the item stays checked.</p>
  
  <p>Here's my sample code:</p>
  
  <p>menu_navigation.xml:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;group
          android:id="@+id/nav_group_1"
          android:checkableBehavior="single"&gt;
      &lt;item
              android:id="@+id/nav_feed"
              android:title="@string/feed"/&gt;
      &lt;item
              android:id="@+id/nav_people"
              android:title="@string/people"/&gt;
  &lt;/group&gt;
  &lt;group
          android:id="@+id/nav_group_2"
          android:checkableBehavior="single"&gt;
      &lt;item
              android:id="@+id/nav_settings"
              android:title="@string/settings"/&gt;
      &lt;item
              android:id="@+id/nav_help_feedback"
              android:title="@string/help_feedback"/&gt;
      &lt;item
              android:id="@+id/nav_logout"
              android:title="@string/logout"/&gt;
  &lt;/group&gt;
  </code></pre>
  
  <p></p>
  
  <p>NavigationItemSelectedListener:</p>
  
  <pre><code> mUiNavigationView.setNavigationItemSelectedListener(
                  new NavigationView.OnNavigationItemSelectedListener() {
                      @Override
                      public boolean onNavigationItemSelected(MenuItem menuItem) {
                          if (previousItem != null)
                             previousItem.setChecked(false);
                          currentItem.setChecked(true);
                          //...
                          changeCurrentFragment(...);
                          return true;
                      }
                  });
  </code></pre>
  
  <p>I need a hint! Thanks.</p>