title: How to reset the Toolbar position controlled by the CoordinatorLayout?
body: <p>The app I'm working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows:</p>
  
  <pre><code>&lt;FrameLayout 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:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
  &lt;android.support.v4.widget.DrawerLayout
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
          android:id="@+id/coordinator"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;FrameLayout
              android:id="@+id/container"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
          &lt;include
              android:id="@+id/appbar"
              layout="@layout/appbar" /&gt;
  
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;android.support.design.widget.NavigationView
          android:id="@+id/navigation_drawer"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          app:headerLayout="@layout/header_drawer"
          app:menu="@menu/menu_nav"&gt;
      &lt;/android.support.design.widget.NavigationView&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>This is a very common pattern, only thing that changes frequently is the Fragment inside the container layout.</p>
  
  <p>If any of the Fragment has a scrolling element, upon scrolling, the CoordinatorLayout will happily make position translations, including the Toolbar/AppBarLayout.</p>
  
  <p>The real problem here is, when the Fragment gets replaced, the position for the Toolbar remains the same, i.e., if the Toolbar is hidden, it will stay so 
  which isn't intended. </p>
  
  <p>Result is this:</p>
  
  <p>This:</p>
  
  <p><img src="https://i.stack.imgur.com/v4ZfV.png" alt="After scroll"></p>
  
  <p>Gets stuck:</p>
  
  <p><img src="https://i.stack.imgur.com/3w8FM.png" alt="Then change "></p>
  
  <p>How can one reset the Toolbar position for this case?</p>
  
  <p><strong>EDIT:</strong>
  A bug is probable, the AppBarLayout offset change listener gets called only when relaunching the app (press back button and open the app), and stops getting called again after an intense fling.</p>