问题
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?
回答1:
Use below code
Glide.with(mContext).load(ImageUrl).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView);
来源:https://stackoverflow.com/questions/31066866/find-and-load-cached-image-in-glide