使毕加索的缓存无效 [英] Invalidate cache in Picasso
问题描述
我使用 Picasso 从磁盘加载图像,例如 Picasso.with(ctx).load(newFile("/path/to/image")).into(imageView)
,但是每当我在该文件中保存新图像并刷新我的 ImageView
时,毕加索仍然有位图缓存.
I load an image from disk using Picasso, e.g., Picasso.with(ctx).load(new File("/path/to/image")).into(imageView)
, but whenever I save a new image in that file, and refresh my ImageView
, Picasso still has the bitmap cached.
是否可以使 Picasso 中的缓存失效?
Is it possible to invalidate the cache in Picasso?
推荐答案
在最近的 Picasso 版本中,有一个新的 invalidate 方法,没有任何解决方法,所以我认为前面提到的自定义 PicassoTools 类现在已经过时了这种情况
In the recent versions of Picasso, there is a new method for invalidate, without any workarounds, so I think that custom PicassoTools class mentioned earlier, is now obsolete in this case
Picasso.with(getActivity()).invalidate(file);
这篇关于使毕加索的缓存无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!