title: requestLayout() improperly called by android.support.design.widget.CollapsingToolbarLayout
body: <p>I am getting a weird behavior in my CoordinatorLayout  I have an Activity which calls another Activity  However when I press back button in My app For 1st item it getting returned to the calling activity Correctly however for second Item I have to press back button two times and so on. heres my Xml file</p>
  
  <pre><code>&lt;android.support.design.widget.CoordinatorLayout
      android:id="@+id/coordinativelayout"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      xmlns:fontFamily="http://schemas.android.com/tools"&gt;
  
      &lt;android.support.design.widget.AppBarLayout
          android:id="@+id/appbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:fitsSystemWindows="true"
          android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"&gt;
  
          &lt;android.support.design.widget.CollapsingToolbarLayout
              android:id="@+id/collapsing_toolbar"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fitsSystemWindows="true"
              app:contentScrim="@color/primaryColor"
              app:expandedTitleMarginBottom="32dp"
              app:expandedTitleMarginEnd="64dp"
              app:expandedTitleMarginStart="48dp"
              app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;
  
              &lt;ImageView
                  android:id="@+id/detail_header_imageview"
                  android:layout_width="match_parent"
                  android:layout_height="300dp"
                  android:layout_alignParentTop="true"
                  android:fitsSystemWindows="true"
                  android:scaleType="centerCrop"
                  app:layout_collapseMode="parallax"/&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/detail_app_bar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:theme="@style/ThemeOverlay.AppCompat.Light"/&gt;
          &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
      &lt;/android.support.design.widget.AppBarLayout&gt;
  
      &lt;android.support.v4.widget.NestedScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_gravity="fill_vertical"
          android:layout_marginBottom="?attr/actionBarSize"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;
  
          &lt;RelativeLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
  
              &lt;ImageView
                  android:id="@+id/poster_image_view"
                  android:layout_width="100dp"
                  android:layout_height="150dp"
                  android:layout_marginBottom="15dp"
                  android:layout_marginTop="25dp"
                  android:layout_marginLeft="15dp"
                  android:layout_marginRight="15dp"/&gt;
  
              &lt;TextView
                  android:id="@+id/release"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:textAppearance="?android:textAppearanceLarge"
                  android:layout_marginTop="25dp"
                  android:textStyle="bold|normal"
                  android:fontFamily="sans-serif-thin"
                  android:layout_toRightOf="@id/poster_image_view"
                  android:text="@string/release_date"/&gt;
              &lt;TextView
                  android:id="@+id/releaseDate"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_toRightOf="@id/poster_image_view"
                  android:layout_below="@id/release"
                  android:layout_marginBottom="10dp"
                  android:layout_marginTop="5dp"/&gt;
              &lt;ImageView
                  android:id="@+id/star_image_view"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:src="@drawable/star_32dp"
                  android:layout_below="@id/releaseDate"
                  android:layout_toRightOf="@id/poster_image_view"
                  /&gt;
              &lt;TextView
                  android:id="@+id/rating"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:textStyle="bold|normal"
                  android:layout_toRightOf="@id/star_image_view"
                  android:layout_below="@id/releaseDate"
                  android:layout_marginLeft="5dp"
                  android:layout_marginRight="5dp"/&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_toRightOf="@id/rating"
                  android:layout_marginRight="5dp"
                  android:layout_below="@id/releaseDate"
                  android:text="@string/out_of_ten"/&gt;
  
              &lt;TextView
                  android:id="@+id/moviedescription"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_below="@id/poster_image_view"
                  android:layout_marginLeft="5dp"
                  android:layout_marginRight="5dp"
                  android:layout_marginTop="5dp"
                  android:gravity="center"/&gt;
          &lt;/RelativeLayout&gt;
      &lt;/android.support.v4.widget.NestedScrollView&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>Heres the Fragment that is inflating the layout file </p>
  
  <pre><code>public class DetailMovieFragment extends Fragment {
  
      private final String BASE_URl = "http://image.tmdb.org/t/p/w500/";
      private static final String BUNDLE_INT = "DetailMovie";
      private int mItemPosition;
      private Format mFormatter;
  
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          mItemPosition = getArguments().getInt(DetailMovieActivity.BUNDLE_ARGS);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment_detail_movie, container, false);
          Toolbar toolbar = (Toolbar) view.findViewById(R.id.detail_app_bar);
          ((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
  
          //TextView represents the Synopsis of the Movie
          TextView plot = (TextView) view.findViewById(R.id.moviedescription);
  
          //poster
          ImageView poster = (ImageView) view.findViewById(R.id.poster_image_view);
  
          TextView releaseDate = (TextView) view.findViewById(R.id.releaseDate);
          TextView rating = (TextView) view.findViewById(R.id.rating);
  
  
          CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) view.findViewById(R.id.collapsing_toolbar);
          final CollapsingToolbarLayout templayout = collapsingToolbarLayout;
          collapsingToolbarLayout.setTitle(MovieDataList.get(getActivity()).getSingleResultByPosition(mItemPosition).getOriginal_title());
          mFormatter = new SimpleDateFormat("yyyy-MM-dd");
          final Window window = getActivity().getWindow();
  
          //backDrop Poster
          final ImageView imageView = (ImageView) view.findViewById(R.id.detail_header_imageview);
          String header_image = MovieDataList.get(getActivity()).getSingleResultByPosition(mItemPosition).getBackdrop_path();
          Picasso.with(getActivity()).load(BASE_URl + header_image).into(imageView, new Callback() {
              @Override
              public void onSuccess() {
                  Bitmap bmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
                  Palette.Builder builder = new Palette.Builder(bmap);
                  Palette palette = builder.generate();
  
                  //Extracting Colors from the Image to set The ToolBar Color and  status bar Color
                  int darkVibrantColor = palette.getDarkVibrantColor(R.color.darkPrimaryColor);
                  int vibrantColor = palette.getVibrantColor(R.color.primaryColor);
                  templayout.setContentScrimColor(vibrantColor);
  
                  if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) {
                      window.setStatusBarColor(darkVibrantColor);
                      window.setNavigationBarColor(vibrantColor);
                  }
              }
  
              @Override
              public void onError() {
  
              }
          });
          collapsingToolbarLayout = templayout;
  
          rating.setText(String.valueOf(MovieDataList.get(getActivity()).getSingleResultByPosition(mItemPosition).getVote_average()));
          //using MVC Pattern to get Poster Url and then Loading in ImageView
          Picasso.with(getActivity()).load("http://image.tmdb.org/t/p/w185" + MovieDataList.get(getActivity()).getSingleResultByPosition(mItemPosition).getPoster_path()).into(poster);
  
          releaseDate.setText(MovieDataList.get(getActivity()).getSingleResultByPosition(mItemPosition).getRelease_date());
  
          plot.setText(MovieDataList.get(getActivity()).getSingleResultByPosition(mItemPosition).getOverview());
  
          return view;
      }
  }
  </code></pre>
  
  <p>Heres the stack trace </p>
  
  <blockquote>
    <p>07-12 21:25:08.406  31106-31106/com.example.prathamesh.popmovies W/View﹕ requestLayout() improperly called by android.support.v7.widget.Toolbar{3d069b8f V.E..... ......ID 0,0-720,112 #7f0e0070 app:id/detail_app_bar} during layout: running second layout pass<br>
    07-12 21:25:08.429  31106-31106/com.example.prathamesh.popmovies W/View﹕ requestLayout() improperly called by android.support.design.widget.CollapsingToolbarLayout{1ecffe1c V.ED.... ........ 0,0-720,600 #7f0e006e app:id/collapsing_toolbar} during second layout pass: posting in next frame<br>
    07-12 21:25:08.432  31106-31106/com.example.prathamesh.popmovies I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@a50e284 time:54288775    </p>
  </blockquote>