Action bar buttons vanish when toolbar is collapsed
<p>I have created a scrolling view activity that contains EditText's in the toolbar. However, when it collapses, the back button and menu button disappear.
<br/>
I want the back button and menu button to stay there when the app bar is collapsed, but nothing I've tried has had any effect.<br/>
<br/>Here is the XML:
</p>

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

    &lt;android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_tool_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="5dp"
        app:expandedTitleTextAppearance="@style/Widget.AppCompat.ActionBar.TabText"
        app:layout_scrollFlags="scroll|enterAlways"
        app:statusBarScrim="@color/colorPrimary"
        android:fitsSystemWindows="true"&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/toolbar_1"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:layout_collapseMode="pin"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"&gt;
        &lt;/android.support.v7.widget.Toolbar&gt;

    &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;

    &lt;android.support.v7.widget.Toolbar
        android:id="@+id/toolbar_2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:layout_collapseMode="pin"
        app:elevation="0dp"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"&gt;

        &lt;LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingLeft="32dp"
            android:paddingTop="10dp"
            android:paddingBottom="56dp"
            android:paddingRight="16dp"&gt;

            &lt;android.support.design.widget.TextInputLayout
                android:id="@+id/lNameLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/fNameLayout"
                android:layout_marginTop="5dp"&gt;

                &lt;EditText
                    android:id="@+id/assignment_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ems="15"
                    android:textSize="30dp"
                    android:hint="Title"/&gt;
            &lt;/android.support.design.widget.TextInputLayout&gt;

            &lt;android.support.design.widget.TextInputLayout
                android:id="@+id/lNameLayout2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/fNameLayout"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="17dp"&gt;

                &lt;EditText
                    android:id="@+id/assignment_subject"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:hint="Description"/&gt;
            &lt;/android.support.design.widget.TextInputLayout&gt;


        &lt;/LinearLayout&gt;
    &lt;/android.support.v7.widget.Toolbar&gt;

&lt;/android.support.design.widget.AppBarLayout&gt;
&lt;android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    &gt;


        &lt;RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:descendantFocusability="beforeDescendants"
            android:focusableInTouchMode="true" &gt;
            &lt;EditText
                android:layout_width="120dp"
                android:layout_height="wrap_content"
                android:id="@+id/assignment_date"
                android:layout_below="@+id/assignment_subject"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:hint="Due Date"
                /&gt;

            &lt;EditText
                android:layout_width="120dp"
                android:layout_height="wrap_content"
                android:id="@+id/assignment_time"
                android:layout_below="@+id/assignment_date"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:hint="Due Time"
                /&gt;

            &lt;TextView
                android:paddingTop="15dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="Set Notification"
                android:id="@+id/notification_title"
                android:layout_below="@+id/assignment_time" /&gt;
            &lt;EditText
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:id="@+id/notification_date"
                android:layout_below="@+id/notification_title"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:hint="Notification Date"
                /&gt;

            &lt;EditText
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:id="@+id/notification_time"
                android:layout_below="@+id/notification_date"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:hint="Notification Time"
                /&gt;
            &lt;TextView
                android:id="@+id/test"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@+id/notification_time"
                android:text="test"/&gt;

        &lt;/RelativeLayout&gt;




&lt;/android.support.v4.widget.NestedScrollView&gt;

&lt;android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginRight="16dp"
    android:src="@drawable/ic_save_white_24px"
    app:layout_anchor="@id/app_bar"
    app:layout_anchorGravity="bottom|end"
    app:backgroundTint="@color/colorAccent"
    app:pressedTranslationZ="12dp"
    /&gt;
</code></pre>

<p></p>

<p>Here is the code in the class:</p>

<pre><code>@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scrolling_activity_add_assignment);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_1);
        //Toolbar toolbar2 = (Toolbar) findViewById(R.id.toolbar_2);
        setSupportActionBar(toolbar);
       // setSupportActionBar(toolbar2);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setTitle("");

        }
    public boolean onOptionsItemSelected(MenuItem item) {

        switch (item.getItemId())
        {
            case android.R.id.home:
                this.finish();
                return true;
        }
        return true;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
</code></pre>

<p><a href="https://i.stack.imgur.com/VsRpE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsRpE.png" alt="normal layout"></a></p>

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

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

<p>the first image is how it looks before its collapsed, the secodn is how it looks when collapsed, the third is how i want it to look.</p>