Android AppBarLayout collapse toolbar and show scrim colors without delay
<p>I have a CollapsingToolbarLayout with a parallax image in background, i have set scrim colors programmatically, i want to collapse the toolbar when i start the activity if there's no image to show on background, so on activity start i check if there's no image then i call setExpanded(false, false) on AppBarLayout, but it takes around 2 seconds to show the scrim colors, i need to call any method to force it show the scrim colors right on activity create? Or is there any other workaround to force this scrim colors to show on create?</p>

<p>This is my layout res:</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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"&gt;
    &lt;android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="270dp"&gt;

        &lt;android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;

            &lt;ImageView
                android:id="@+id/image"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_collapseMode="parallax" /&gt;
            &lt;include layout="@layout/toolbar"/&gt;

        &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;

    &lt;/android.support.design.widget.AppBarLayout&gt;

    &lt;include layout="@layout/content" /&gt;
&lt;/android.support.design.widget.CoordinatorLayout&gt;
</code></pre>