使毕加索的缓存无效 [英] Invalidate cache in Picasso

查看:31
本文介绍了使毕加索的缓存无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆