Image first time not displayed when using onResourceReady #994

Closed
@valibran

Description

This code sometimes works and sometimes it doesn't work(the image is not displayed), but only when a certain image uri is called for the first time:

Glide.with(context).load(uri).fitCenter().centerCrop()
    .into(new GlideDrawableImageViewTarget(imageView) {
        @Override
        public void onResourceReady(GlideDrawable drawable, GlideAnimation anim) {
            super.onResourceReady(drawable, anim);
            //some other action

This code works always(the image is displayed):

Glide.with(context).load(uri).fitCenter().centerCrop()
    .into(imageView);

It seems there is a random caching issue when using the code that can also do a task after the resource is loaded.

Tested with 'com.github.bumptech.glide:glide:3.7.0'.