title: How create a custom Spinner toolbar dropdown in android
body: <p>I need to add a custom Spinner drop-down to my action bar.In main-activity  I'm using following code.</p>
  
  <pre><code>    private Toolbar mToolbar;
      private Spinner mToolbarSpinner;
      private List&lt;SpinnerNavItem&gt; mToolbarSpinnerNavigationItems;
      private BaseAdapter mArrayAdapter;
  
      mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
      setSupportActionBar(mToolbar);
      getSupportActionBar().setDisplayShowHomeEnabled(true);
      getSupportActionBar().setDisplayShowTitleEnabled(false);
  
         /*Setup a Spinner*/
      mToolbarSpinner = (Spinner) findViewById(R.id.spinner_toolbar);
      /*Manage the spinner*/
      mToolbarSpinnerNavigationItems = new ArrayList&lt;SpinnerNavItem&gt;();
  
      mToolbarSpinnerNavigationItems.add(new SpinnerNavItem("Local", R.drawable.deviceonline,"device namne1","port",false));
      mToolbarSpinnerNavigationItems.add(new SpinnerNavItem("My Places", R.drawable.deviceonline,"device name2","port2",false));
  
      mArrayAdapter = new ArrayAdapter(this, R.layout.support_simple_spinner_dropdown_item,
              mToolbarSpinnerNavigationItems);
  
      mToolbarSpinner.setAdapter(mArrayAdapter);
  </code></pre>
  
  <p>when I run the project I’m getting following output</p>
  
  <p><img src="https://i.stack.imgur.com/qaT32.png" alt="enter image description here"></p>
  
  <p>how can I fix this problem?</p>