There are minor changes in accordance with the latest version of Glide . Now we need to use submit() to load the image as a bitmap, unless you use the submit() method, the listener will not be called.
Here is a working example that I used today.
Glide.with(cxt) .asBitmap().load(imageUrl) .listener(new RequestListener<Bitmap>() { @Override public boolean onLoadFailed(@Nullable GlideException e, Object o, Target<Bitmap> target, boolean b) { Toast.makeText(cxt,getResources().getString(R.string.unexpected_error_occurred_try_again),Toast.LENGTH_SHORT).show(); return false; } @Override public boolean onResourceReady(Bitmap bitmap, Object o, Target<Bitmap> target, DataSource dataSource, boolean b) { zoomImage.setImage(ImageSource.bitmap(bitmap)); return false; } } ).submit();
This works, and I get a bitmap from the listener.
source share