<p dir="auto">I've got 3 views that I'm loading random images into on a timer.  I'm trying to crossfade the new image with the currently displayed image.  I basically get a random image from a list of about 10 and call the method below 3 times (with different views) every 6 seconds.</p>
<p dir="auto">This works most of the time, but sometimes it crashes due to the exception included below. When I was using a button click to do the update I was able to have this exception happen pretty easily.   I'm wondering if there is some sort of race condition internally on the fetch and render between the previous call and the new call?</p>
<p dir="auto">Is there a better way to do this or should this work as I'm currently using it?</p>
<p dir="auto">Using 3.6.1</p>
<p dir="auto">Here's the code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mDownloadedSize is the max of the screen width or height - I'm using this so rotations have immediate cache hit image loading.  

private void loadImage(ImageView view, String photoUrl)
{
            Drawable oldImage = view.getDrawable();
            Glide.with(MyFragment.this)
                 .load(photoUrl)
                 .crossFade()
                 .placeholder(oldImage)
                 .override(mDownloadSize, mDownloadSize)
                 .centerCrop()
                 .into(view);
}"><pre class="notranslate"><code class="notranslate">mDownloadedSize is the max of the screen width or height - I'm using this so rotations have immediate cache hit image loading.  

private void loadImage(ImageView view, String photoUrl)
{
            Drawable oldImage = view.getDrawable();
            Glide.with(MyFragment.this)
                 .load(photoUrl)
                 .crossFade()
                 .placeholder(oldImage)
                 .override(mDownloadSize, mDownloadSize)
                 .centerCrop()
                 .into(view);
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@20260fad
            at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1282)
            at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:599)
            at com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable.draw(GlideBitmapDrawable.java:101)
            at com.bumptech.glide.request.target.SquaringDrawable.draw(SquaringDrawable.java:151)
            at android.graphics.drawable.TransitionDrawable.draw(TransitionDrawable.java:198)
            at android.widget.ImageView.onDraw(ImageView.java:1158)
            at android.view.View.draw(View.java:15231)
            at android.view.View.updateDisplayListIfDirty(View.java:14167)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewG"><pre class="notranslate"><code class="notranslate">    java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@20260fad
            at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1282)
            at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:599)
            at com.bumptech.glide.load.resource.bitmap.GlideBitmapDrawable.draw(GlideBitmapDrawable.java:101)
            at com.bumptech.glide.request.target.SquaringDrawable.draw(SquaringDrawable.java:151)
            at android.graphics.drawable.TransitionDrawable.draw(TransitionDrawable.java:198)
            at android.widget.ImageView.onDraw(ImageView.java:1158)
            at android.view.View.draw(View.java:15231)
            at android.view.View.updateDisplayListIfDirty(View.java:14167)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
            at android.view.View.updateDisplayListIfDirty(View.java:14127)
            at android.view.View.getDisplayList(View.java:14189)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewG
</code></pre></div>
<p dir="auto">I'm using glide to load an image into the background of one of my activities.  This background image changes very often and I use the crossfade() to animate between the image changes.  This works all fine and dandy when the image is not in the cache.. the crossfade works as expected.  However, it seems that if the image was already in the memory cache, the animation does not happen and the image just instantly loads.</p>
<p dir="auto">Is it currently possible to always animate regardless if its in the cache or not?  If not, can this be added?  The instant loading really messes with the fluidity of my app</p>