title: How to set Custom ActionBar to fixed top position inside ScrollView layout?
body: <p>How do I set this action bar in a way even when scroll the long data screen it keeps visible on the top of the screen?</p>
  
  <p>toolbar.xml:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  </code></pre>
  
  <p>Guys please see my update:
  I tried everything but it seems that next component after actionBar is not being set after actionBar but behind it:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="match_parent"
  android:background="@drawable/background_telas"
  android:orientation="vertical" &gt;
  
  &lt;include layout="@layout/toolbar" /&gt;
  
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;ScrollView
          android:id="@+id/scrollView"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:fillViewport="true" &gt;
  
          &lt;LinearLayout
              android:layout_width="fill_parent"
              android:layout_height="match_parent"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/textView1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="TextView" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p><img src="https://i.stack.imgur.com/xJkhf.png" alt="enter image description here"></p>
  
  <pre><code>&lt;android.support.v7.widget.Toolbar
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/actionBar"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="@color/actionBarBackgroundColor"
      app:contentInsetEnd="0dp"
      app:contentInsetStart="0dp" &gt;
  &lt;/android.support.v7.widget.Toolbar&gt;
  
  &lt;View
      android:layout_width="match_parent"
      android:layout_height="1dp"
      android:background="#A0A09F" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>Project (eclipse):
  <img src="https://i.stack.imgur.com/Wd3YO.png" alt="Project in eclipse IDE"></p>
  
  <p>Screen stopped:
  <img src="https://i.stack.imgur.com/1SrAN.png" alt="Screen stopped showing acationbar on top"></p>
  
  <p>Screen scrolled up:
  <img src="https://i.stack.imgur.com/Mzyl0.png" alt="Screen scrolled up showing the actionbar going up with other data"></p>
  
  <p>Java:</p>
  
  <pre><code>    Toolbar actionBar = (Toolbar) findViewById(R.id.actionBar);
      actionBar.setTitle("ProTaxi Passageiro");
      actionBar.setSubtitle("Cadastro");
      actionBar.setTitleTextColor(Color.parseColor("#846A1A"));
      setSupportActionBar(actionBar);
  </code></pre>