title: Selected items in menu
body: <p>How to correctly display the selected items in the menu? via (with grey background):</p>
  
  <p><a href="https://i.stack.imgur.com/9LC3H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9LC3H.png" alt="enter image description here"></a></p>
  
  <p>At the moment:</p>
  
  <p><a href="https://i.stack.imgur.com/Fa2cs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fa2cs.png" alt="enter image description here"></a></p>
  
  <p>Why without grey background?</p>
  
  <p><strong>My XML Menu:</strong></p>
  
  <pre><code>&lt;menu
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;group&gt;
  
          &lt;item
              android:id="@+id/night"
              android:icon="@drawable/ic_brightness_3_black_24dp"
              android:title="@string/navigation_view_item_1" /&gt;
  
          &lt;item
              android:id="@+id/nearbyParkingPlaces"
              android:icon="@drawable/ic_local_parking_black_24dp"
              android:title="@string/navigation_view_item_2" /&gt;
  
          &lt;item
              android:id="@+id/traffic"
              android:icon="@drawable/ic_traffic_black_24dp"
              android:title="@string/navigation_view_item_3" /&gt;
  
      &lt;/group&gt;
  
      ...
  
  &lt;/menu&gt;
  </code></pre>
  
  <p><strong>My code for NavigationItemSelectedListener:</strong></p>
  
  <pre><code>navigation.setNavigationItemSelectedListener { menuItem -&gt;
          drawerLayout.closeDrawers()
          when (menuItem.itemId) {
              R.id.night -&gt; if (menuItem.isChecked) {
                  menuItem.isChecked = false
                  ...
              } else {
                  menuItem.isChecked = true
                  ...
              }
              R.id.nearbyParkingPlaces -&gt; if (menuItem.isChecked) {
                  menuItem.isChecked = false
                  ...
              } else {
                  menuItem.isChecked = true
                  ...
              }
              R.id.traffic -&gt; if (menuItem.isChecked) {
                  menuItem.isChecked = false
                  ...
              } else {
                  menuItem.isChecked = true
                  ...
              }
              ...
          }
          false
      }
  </code></pre>
  
  <p>What am I doing wrong or I missed something?</p>
  
  <hr>
  
  <p>If add <code>android:checkableBehavior="all"</code> in <code>&lt;group&gt;</code> - selected item have grey background, but selected elements are not combine. The previous selected item is reset... I don't understand, why and how fix it?</p>
  
  <hr>
  
  <p><strong>The solution was found</strong></p>