title: How to add an item to a menu group in NavigationView
body: <p>In a word game for Android I currently have a hardcoded menu inflated from <code>left_drawer_menu.xml</code> and consisting of 3 groups (my turn, opponent turn and finally other stuff):</p>
  
  <p><a href="https://i.stack.imgur.com/IcJjU.png"><img src="https://i.stack.imgur.com/IcJjU.png" alt="app screenshot"></a></p>
  
  <pre><code>mLeftDrawer = (NavigationView) findViewById(R.id.left_drawer);
  mLeftDrawer.setNavigationItemSelectedListener(
          new NavigationView.OnNavigationItemSelectedListener() {
              @Override
              public boolean onNavigationItemSelected(final MenuItem menuItem) {
                  Menu menu = mLeftDrawer.getMenu();
  
                  if (menuItem.getGroupId() == R.id.my_move) {
                      menu.setGroupCheckable(R.id.my_move, true, true);
                      menu.setGroupCheckable(R.id.his_move, false, false);
                      menu.setGroupCheckable(R.id.extras, false, false);
                  } else if (menuItem.getGroupId() == R.id.his_move) {
                      menu.setGroupCheckable(R.id.my_move, false, false);
                      menu.setGroupCheckable(R.id.his_move, true, true);
                      menu.setGroupCheckable(R.id.extras, false, false);
                  } else if (menuItem.getGroupId() == R.id.extras) {
                      menu.setGroupCheckable(R.id.my_move, false, false);
                      menu.setGroupCheckable(R.id.his_move, false, false);
                      menu.setGroupCheckable(R.id.extras, true, true);
                  }
  
                  menuItem.setChecked(true);
                  mLeftItem = menuItem.getItemId();
                  mDrawerLayout.closeDrawer(mLeftDrawer);
                  mHandler.postDelayed(new Runnable() {
                      @Override
                      public void run() {
                          if (mLeftItem == R.id.start) {
                              startNewGame();
                          } 
                      }
                  },DRAWER_CLOSE_DELAY);
  
                  return true;
              }
          });
  </code></pre>
  
  <p>Now I am trying to change that menu dynamically.</p>
  
  <p>I have SQLite instance containing all game data and use <code>IntentService</code> to read/write the database - that part works fine.</p>
  
  <p>My current difficulty is: with the following code, the new items are added <em>outside</em> the <code>R.id.my_move</code> group:</p>
  
  <pre><code>if (mLeftItem == R.id.start) {
      startNewGame();
  
      Random r = new Random();
      int i = r.nextInt(100);
      menu.add(R.id.my_move, i, i, "Item " + i);   // why is my_move ignored?
  } 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yC5j6.png"><img src="https://i.stack.imgur.com/yC5j6.png" alt="app screenshot"></a></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>As a further test I have tried assigning even and not even items to 2 separate groups with this code:</p>
  
  <pre><code>Random r = new Random();
  int i = r.nextInt(100);
  int group = 1 + (i % 2); // can be 1 or 2
  menu.add(group, i, i, "Item " + i);
  </code></pre>
  
  <p>However the result looks chaotic:</p>
  
  <p><a href="https://i.stack.imgur.com/HiC8i.png"><img src="https://i.stack.imgur.com/HiC8i.png" alt="app screenshot"></a></p>
  
  <p>Also I have discovered the (probably already fixed?) <a href="https://code.google.com/p/android/issues/detail?id=176300">Issue 176300</a> and wonder if maybe sub-menus should be better used instead of menu groups?</p>