android - 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.
解决方案
如果你使用 Glide 来加载图片,你可以完全跳过图片的缓存,方法如下:
Glide.with(fragment)
.load(url)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.into(view);
推荐阅读
- vue.js - 一旦电子邮件文本框激活按钮并确认文本框匹配
- python - 如何将整数乘以浮点数(Python)
- python - 我的条形图没有以颜色显示所有条形,并且希望每个条形图都相同
- python - 为什么输出显示变量而不是用户输入?
- reactjs - 尝试执行 setState 时如何防止更新 redux 存储数据?
- mongodb - MongoDB 比多个 distinct("key1.key2") 或聚合 $group + $addToSet 更优化的方法
- spring - 嵌入式 Tomcat 两次调用 WebApplicationInitializer
- python - 有没有办法将熊猫应用的输出连接到单个多索引中?
- mysql - 对数组列进行排序
- python - 理解 Python 函数文档的指南