title: dynamic adding item to NavigationView in Android
body: <p>I want to build <code>NavigationDrawer</code> with the possibility of adding new items (such as yahoo weather App with adding new cities). I have working <code>NavigationDrawer</code> with <code>NavigationView</code>, in menu I have permanent fields:</p>
  
  <pre><code>   &lt;group
          android:id="@+id/group"
          android:checkableBehavior="single"&gt;
          &lt;item
              android:checked="false"
              android:id="@+id/item1"
              android:icon="@drawable/ic_inbox_black_24dp"
              android:title="Item1" /&gt;
          &lt;item
              android:checked="false"
              android:id="@+id/Item2"
              android:icon="@drawable/ic_inbox_black_24dp"
              android:title="Item2"
              /&gt;
      &lt;/group&gt;
  </code></pre>
  
  <p>I'm trying to add new <em>Item</em> this method:</p>
  
  <pre><code> public boolean addNewItem(String itemName){
          Menu menu = navigationView.getMenu();
          menu.add(R.id.group,Menu.NONE,Menu.NONE,itemName);
          return true;
   }
  </code></pre>
  
  <p>And I'm getting not exactly what I want:
  <a href="https://i.stack.imgur.com/mDiRh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mDiRh.png" alt="Result"></a></p>
  
  <p>Does anyone have an idea how to solve this problem? Or why is this happening?
  I do not know where and how one can hold information about the added elements. Any ideas? </p>