How to add a spinner next to a menu in the toolbar
<p>I want my spinner to be next to my menu in the toolbar (to the left of the menu), but currently the spinner appear below the menu. Do i have to add it somehow inside the <code>onCreateOptionsMenu(Menu menu)</code></p>

<p><a href="https://i.stack.imgur.com/qpKMY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qpKMY.png" alt="enter image description here"></a></p>

<p><strong>My Activity:</strong></p>

<pre><code>  protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);

 Spinner spinner = (Spinner) findViewById(R.id.travelType_spinner);
        // Create an ArrayAdapter using the string array and a default spinner layout
        ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
                R.array.travelType_array, R.layout.spinner_item);
        // Specify the layout to use when the list of choices appears
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        // Apply the adapter to the spinner
        if (spinner != null) {
            spinner.setAdapter(adapter);
        }
</code></pre>

<p><strong>Layout:</strong></p>

<pre><code>&lt;android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;

        &lt;Spinner
            android:id="@+id/travelType_spinner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            /&gt;
    &lt;/android.support.design.widget.AppBarLayout&gt;
</code></pre>

<p><strong>Spinner_item.xml</strong></p>

<pre><code>&lt;TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textColor="@color/whiteText"
    android:textStyle="bold"
    android:padding="15dp"/&gt;
</code></pre>