I am new in glide and want to migrate my app from universalimageloader to glide. I want to convert cached image from the disk into image file, and show it into an ImageView.
When I use universalimageloader, I can do it easily with this way:
File imageFile = DiskCacheUtils.findInCache(image_url, ImageLoader.getInstance().getDiscCache());
//then show it into image view
String file_target = "file://"+imageFile.getPath();
ImageLoader.getInstance().displayImage(target, imageView);
However I have not found a way from documentation to do that in Glide.
Is it possible?
By default, Glide uses memory and disk caching to avoid unnecessary network calls, it checks into multiple layers of caches before initiating a new request call for an image.
Glide will put all image resources into the memory cache by default. Thus, a specific call . skipMemoryCache( false ) is not necessary. Hint: beware of the fact, that if you make an initial request to the same URL without the .
Use below code
Glide.with(mContext).load(ImageUrl).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With