title: ScrollView not working properly with tabbed activity
body: <p>I am creating an activity with tabs and view pager. I used the default tabbed activity template provided by android studio to create it. My problem is that I am not able add scroll to fragments layout added in view pager.
  I read from this link <a href="https://stackoverflow.com/questions/33354845/scrollview-not-working-with-tabbed-layout-in-android">Add ScrollView to Tab Activity</a></p>
  
  <p>and removed this 
  <code>app:layout_behavior="@string/appbar_scrolling_view_behavior"</code>.</p>
  
  <p>But when I added this line to scrollview my tabs and action bar were also gone.I have already added my fragment in scrollview but it doesn't work .</p>
  
  <p>Here is my main and fragment xml</p>
  
  <p>Main.xml</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout 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:id="@+id/main_content"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context="com.webninjaz.kirti.dnschanger.activities.MainActivity"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/appbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:paddingTop="@dimen/appbar_padding_top"
          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="#5A595B"
              app:layout_scrollFlags="scroll|enterAlways"
              app:popupTheme="@style/AppTheme.PopupOverlay"&gt;
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="DNS CHANGER"
                  android:layout_gravity="center"
                  android:id="@+id/toolbar_title"
                  android:textSize="22sp"
                  android:textStyle="bold"
                  android:textColor="#ffffff"/&gt;
          &lt;/android.support.v7.widget.Toolbar&gt;
  
          &lt;android.support.design.widget.TabLayout
              android:id="@+id/tabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="#727272"/&gt;
  
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Fragment xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:background="#ccc"
      android:focusableInTouchMode="true"&gt;
  
      &lt;ScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:orientation="vertical"
              android:layout_height="wrap_content"&gt;
                      &lt;TextView
                          android:layout_width="fill_parent"
                          android:layout_height="fill_parent"
                          android:gravity="center"
                          android:id="@+id/TopHeader"
                          android:text="Current WIFI Info"
                          android:paddingRight="15dp"
                          android:textAppearance="?android:attr/textAppearanceMedium"
                          android:layout_marginTop="20dp"/&gt;
              &lt;LinearLayout
                  android:layout_width="fill_parent"
                  android:layout_marginTop="10dp"
                  android:orientation="horizontal"
                  android:layout_height="wrap_content"
                  android:baselineAligned="false"&gt;
  
                  &lt;LinearLayout
                      android:layout_width="0dp"
                      android:layout_weight=".50"
                      android:paddingRight="5dp"
                      android:orientation="vertical"
                      android:layout_height="wrap_content"&gt;
                      &lt;TextView
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:gravity="right"
                          android:textAlignment="gravity"
                          android:id="@+id/WiFiConnectLeft"
                          android:text="Wifi Name :"/&gt;
                      &lt;TextView
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:gravity="right"
                          android:textAlignment="gravity"
                          android:id="@+id/DefaultGatewayLeft"
                          android:text="Default Gateway :"/&gt;
                      &lt;TextView
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:gravity="right"
                          android:textAlignment="gravity"
                          android:id="@+id/DNS1Left"
                          android:text="Primary DNS :"/&gt;
                      &lt;TextView
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:gravity="right"
                          android:textAlignment="gravity"
                          android:id="@+id/DNS2Left"
                          android:text="Secondary DNS :"/&gt;
                      &lt;TextView
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:gravity="right"
                          android:textAlignment="gravity"
                          android:id="@+id/CurrentIPLeft"
                          android:text="IP Address :"/&gt;
                  &lt;/LinearLayout&gt;
                  &lt;LinearLayout
                      android:layout_width="0dp"
                      android:layout_weight=".50"
                      android:paddingLeft="5dp"
                      android:orientation="vertical"
                      android:layout_height="wrap_content"&gt;
                      &lt;TextView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:gravity="left"
                          android:id="@+id/WiFiConnectedText"
                          android:textAlignment="gravity"
                          android:text=""/&gt;
                      &lt;TextView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:id="@+id/DefaultGatewayText"/&gt;
                      &lt;TextView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:id="@+id/DNS1Text"/&gt;
                      &lt;TextView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:id="@+id/DNS2Text"/&gt;
                      &lt;TextView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:id="@+id/CurrentIPText"/&gt;
                  &lt;/LinearLayout&gt;
              &lt;/LinearLayout&gt;
  
                  &lt;TextView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="CHANGE DNS"
                      android:layout_gravity="center"
                      android:textAlignment="gravity"
                      android:id="@+id/MiddleHeaderText"
                      android:layout_marginTop="20dp"
                      android:textAppearance="?android:attr/textAppearanceMedium"
                      android:textStyle="bold"
                      android:textColor="#000"
                      android:textSize="20sp"/&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="50dp"
                  android:layout_below="@+id/tv_title"
                  android:orientation="horizontal"
                  android:weightSum="3"
                  android:layout_marginTop="50dp"
                  android:id="@+id/lin_primary"
                  android:gravity="center_vertical"
                  android:paddingRight="15dp"&gt;
                  &lt;TextView
                      android:layout_width="0dp"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:text="@string/primary"
                      android:textStyle="bold"
                      android:textColor="#000"
                      android:id="@+id/PrimaryDNSText"
                      android:gravity="center"
                      android:paddingLeft="@dimen/activity_horizontal_margin"
                      android:textSize="13sp"/&gt;
                  &lt;EditText
                      android:layout_width="0dp"
                      android:layout_height="30dp"
                      android:layout_weight="1.2"
                      android:background="#000"
                      android:textColor="#ffffff"
                      android:inputType="numberDecimal"
                      android:layout_marginRight="10dp"
                      android:maxLength="16"
                      android:id="@+id/EDITDNS1"
                      android:gravity="center"
                      android:text=""/&gt;
                  &lt;Button
                      android:layout_width="0dp"
                      android:layout_height="30dp"
                      android:layout_weight="0.8"
                      android:text="BROWSE"
                      android:gravity="center"
                      android:background="@drawable/textview_click"
                      android:textColor="#ffffff"
                      android:id="@+id/BrowseDNS1"/&gt;
              &lt;/LinearLayout&gt;
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="50dp"
                  android:layout_below="@+id/lin_primary"
                  android:orientation="horizontal"
                  android:weightSum="3"
                  android:layout_marginTop="30dp"
                  android:id="@+id/lin_secondary"
                  android:gravity="center_vertical"
                  android:paddingRight="15dp"&gt;
                  &lt;TextView
                      android:layout_width="0dp"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:text="@string/secondary"
                      android:textColor="#000"
                      android:id="@+id/SecondaryDNSText"
                      android:paddingLeft="@dimen/activity_horizontal_margin"
                      android:textSize="12sp"
                      android:gravity="center"/&gt;
                  &lt;EditText
                      android:layout_width="0dp"
                      android:layout_height="30dp"
                      android:layout_weight="1.2"
                      android:background="#000"
                      android:textColor="#ffffff"
                      android:inputType="numberDecimal"
                      android:layout_marginRight="10dp"
                      android:maxLength="16"
                      android:id="@+id/EDITDNS2"
                      android:gravity="center"
                      android:text=""
                      /&gt;
                  &lt;Button
                      android:layout_width="0dp"
                      android:layout_height="30dp"
                      android:layout_weight="0.8"
                      android:text="BROWSE"
                      android:gravity="center"
                      android:background="@drawable/textview_click"
                      android:textColor="#ffffff"
                      android:id="@+id/BrowseDNS2"/&gt;
              &lt;/LinearLayout&gt;
              &lt;LinearLayout
                  android:layout_width="fill_parent"
                  android:gravity="center"
                  android:layout_marginTop="15dp"
                  android:layout_height="wrap_content"&gt;
                  &lt;Button
                      android:layout_width="wrap_content"
                      android:layout_height="40dp"
                      android:id="@+id/UpdateDNS"
                      android:text="Update"
                      android:background="@drawable/textview_click"
                      android:textColor="#ffffff"/&gt;
                  &lt;Button
                      android:layout_width="wrap_content"
                      android:layout_height="40dp"
                      android:id="@+id/ResetWifi"
                      android:text="RESET"
                      android:background="@drawable/textview_click"
                      android:textColor="#ffffff"
                      android:layout_marginLeft="20dp"/&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>