title: Dynamically add items to NavigationView with loading gif
body: <p>I have a Navigation View (sidebar) that looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/wKC4X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wKC4X.png" alt="enter image description here"></a></p>
  
  <p>The first 4 items in the list are static (they will never change). However, I need to dynamically add items to the sidebar (which are fetched from my REST API) below the divider in the picture above. A few questions:</p>
  
  <ol>
  <li>How can I dynamically add new items to the sidebar under a new subheader, below the divider?</li>
  <li>While it's adding the items, how can I display a loading (spinner) gif below the divider to notify the user that something is happening?</li>
  </ol>
  
  <p>Here is the NavigationView from my activity:</p>
  
  <pre><code>&lt;android.support.design.widget.NavigationView
      android:id="@+id/navigation_view"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:background="@android:color/white"
      app:menu="@menu/menu_drawer"
      /&gt;
  </code></pre>
  
  <p>And here is my <code>menu_drawer</code> (with the static items):</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;group android:checkableBehavior="single"&gt;
          &lt;item
              android:icon="@drawable/ic_first"
              android:title="Inbox"
              android:checked="true"/&gt;
          &lt;item
              android:icon="@drawable/ic_second"
              android:title="Starred" /&gt;
          &lt;item
              android:icon="@drawable/ic_third"
              android:title="Sent mail" /&gt;
          &lt;item
              android:icon="@drawable/ic_fourth"
              android:title="Drafts" /&gt;
      &lt;/group&gt;
  &lt;/menu&gt;
  </code></pre>