Swiping to Fragment in ViewPager always scrolls to RecyclerView?
<p>I have a <code>Fragment</code> that I display in my <code>ViewPager</code> that has a <code>View</code> with some information about a user and below it a <code>RecyclerView</code>. The issue is, every time I scroll to that <code>Fragment</code>, the page automatically scrolls down to where <code>RecyclerView</code> begins and I don't want that to happen. Rather I would want you to scroll to the place where you last left off while browsing the <code>Fragment</code>. Here is my attempt:</p>

<p>activity_main.xml:</p>

<pre><code>&lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
    &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.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"
            app:theme="@style/AppTheme.AppBarOverlay"
            app:layout_scrollFlags="scroll|enterAlways" /&gt;
        &lt;android.support.design.widget.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:tabTextColor="@android:color/white"
            app:tabSelectedTextColor="@android:color/white"
            app:tabIndicatorColor="@android:color/white"
            app:tabIndicatorHeight="3dp"/&gt;
    &lt;/android.support.design.widget.AppBarLayout&gt;
    &lt;android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
    &lt;android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_create_white_24dp"
        app:borderWidth="0dp"
        app:layout_behavior="com.tabs.activity.ScrollingFabBehavior"/&gt;
&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>

<p>profile.xml:</p>

<p></p>

<p></p>

<pre><code>&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:id="@+id/profile_header"&gt;

    &lt;TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24sp"
        android:textColor="@color/black"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_marginTop="16dp"
        android:id="@+id/profile_name"/&gt;

    &lt;com.facebook.drawee.view.SimpleDraweeView
        android:layout_marginTop="16dp"
        android:id="@+id/profile_picture"
        android:layout_width="100dp"
        android:layout_height="100dp"
        fresco:roundingBorderColor="@color/white"
        fresco:roundingBorderWidth="10dp"
        fresco:placeholderImageScaleType="centerCrop"
        fresco:placeholderImage="@mipmap/blank_prof_pic"
        fresco:roundAsCircle="true"
        /&gt;

&lt;/LinearLayout&gt;

&lt;LinearLayout
    android:id="@+id/button_row"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:weightSum="4"
    android:layout_below="@id/profile_header"
    android:layout_marginTop="12dp"
    android:layout_height="wrap_content"&gt;

    &lt;RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"&gt;

     ...Content here...

    &lt;/RelativeLayout&gt;

&lt;/LinearLayout&gt;

    &lt;android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/rv_posts_feed"
        android:visibility="gone"
        /&gt;
</code></pre>

<p>
    </p>