首页 > 解决方案 > How to prevent of loading images from previous results?

问题描述

I am implementing search and there are cases when images of old results are loaded and applyed to new ones, so how can I prevent Glide loading images and displaying on imageView when I have new search results.

标签: androidpicassoandroid-glideimage-loading

解决方案


如果你使用 Glide 来加载图片,你可以完全跳过图片的缓存,方法如下:

Glide.with(fragment)
  .load(url)
  .diskCacheStrategy(DiskCacheStrategy.NONE)
  .into(view);

推荐阅读