title: How to add Spinner as an item in Navigation Drawer
body: <p>I want to add spinner as an item in my navigation drawer. Where should I put the spinner as an item? Where to inflate the layout for the spinner? Where to initialize the spinner? I want it to look like this:
  <a href="https://i.stack.imgur.com/MiSdF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MiSdF.jpg" alt="enter image description here"></a></p>
  
  <p>This is where I add my items:</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;group
      android:id="@+id/group1"
      android:checkableBehavior="single"&gt;
      &lt;item
          android:id="@+id/nav_login"
          android:icon="@drawable/ic_login"
          android:title="@string/login_menu_item"/&gt;
      &lt;item
          android:id="@+id/nav_signup"
          android:icon="@drawable/ic_signup"
          android:title="@string/signup_menu_item"/&gt;
      &lt;/group&gt;
  
  &lt;item android:title="@string/language"&gt;
      &lt;menu&gt;
          &lt;item
              android:id="@+id/nav_eng"
              android:title="@string/english"&gt;
          &lt;/item&gt;
  
          &lt;item
              android:id="@+id/nav_heb"
              android:title="@string/hebrew"&gt;
          &lt;/item&gt;
      &lt;/menu&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>This is my layout with the drawer:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:orientation="vertical"&gt;
  
  &lt;android.support.v7.widget.Toolbar
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/toolbar_home"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/colorPrimary"
      android:minHeight="?attr/actionBarSize"
      android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
      app:title="Masü"
      /&gt;
  
  &lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:openDrawer="start"&gt;
  
      &lt;FrameLayout
          android:id="@+id/fragment_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          /&gt;
  
      &lt;android.support.design.widget.NavigationView
          android:id="@+id/nav_view"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          app:itemIconTint="@color/colorAccent"
          app:itemTextColor="@color/textColorSecondary"
          app:menu="@menu/activity_home_drawer"/&gt;
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And on click of an item this is how it works:</p>
  
  <pre><code>public boolean onNavigationItemSelected(MenuItem item) {
      int id = item.getItemId();
      mDrawerLayout.closeDrawers();
  
      if (id == R.id.nav_login) {
          if (mIsLoggedin) {
              logout();
          } else {
              mFragmentTransaction = mFragmentManager.beginTransaction();
              mFragmentTransaction.replace(R.id.fragment_container, new LoginFragment()).commit();
          }
  </code></pre>