Change the background of a CollapsingToolabarLayout
<p>I'd like to change the background of in <code>ImageView</code> inside a <code>CollaspingToolbarLayout</code>. Here is what I tried to do: </p>

<p>activity_main.xml</p>

<pre><code> &lt;android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="250dp"
    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"
        app:contentScrim="@color/colorPrimary"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"&gt;

        &lt;ImageView
            android:id="@+id/collapsingimage"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scaleType="centerCrop"
            android:background="@drawable/teszt1"
            app:layout_collapseMode="parallax" /&gt;

        &lt;android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin" /&gt;

    &lt;/android.support.design.widget.CollapsingToolbarLayout&gt;
&lt;/android.support.design.widget.AppBarLayout&gt;
</code></pre>

<p>MainActivity.java</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    collapsingimage = (ImageView)findViewById(R.id.collapsingimage);
    collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    collapsingToolbarLayout.setTitle("  ");

dynamicToolbarColor();

}

private void dynamicToolbarColor() {

    Bitmap b = imageUrltoBitmap(imgurl);
    collapsingimage.setImageBitmap(b);

    Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.hhg);

        Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {

            @Override
            public void onGenerated(Palette palette) {
                int colorPrimary = getResources().getColor(R.color.colorPrimary);
                int colorPrimaryDark = getResources().getColor(R.color.colorPrimaryDark);
                collapsingToolbarLayout.setContentScrimColor(palette.getMutedColor(colorPrimary));
                collapsingToolbarLayout.setStatusBarScrimColor(palette.getMutedColor(colorPrimary));
                collapsingToolbarLayout.setContentScrimColor(getResources().getColor(R.color.colorPrimary));
            }
        });
}
</code></pre>

<p>So I'd like to load another image instead of I added in the xml file and I set the ImageView's background but nothing happens. Have you any idea how to do it? </p>