Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glide cannot resolve asBitmap()

I found the way to fix it, you must add the asBitmap() right After with() and it will work just like old times.

PS: my Glide Version is 4.7.1


for the asBitmap you need to write it as follows:

Glide.with(getActivity()).asBitmap().load(chalet.profilePhoto).into(mImageView);

// Put asBitmap() right after Glide.with(context)   ,,. 4.0+
// And for SubsamplingScaleImageView use SimpleTarget

  Glide.with(context)
                .asBitmap()
                .load(images[position])
                .apply(RequestOptions.diskCacheStrategyOf(DiskCacheStrategy.AUTOMATIC))
                .into(new SimpleTarget<Bitmap>(width, height) {
                    @Override
                    public void onResourceReady(Bitmap bitmap, Transition<? super Bitmap> transition) {
                        subsampleImageView.setImage(ImageSource.bitmap(bitmap)); //For SubsampleImage
                    }
                });

Call asBitmap() before load()

Glide.with(context)
 .asBitmap()
 .load(uri)