Android Picasso 的缓存怎么清理?

大尾巴鹰 2015-11-16 02:29:25
因为我遇到一个头像上传的问题,用户上传完了新头像,应该Picasso应该重新访问网络的,但是,犹豫路径是一样他就默认不访问网络直接用缓存了. 现在怎么办,让他强制重新访问网络!
...全文
5342 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
AsWoWen 2016-05-18
  • 打赏
  • 举报
回复
试试这个方法
Picasso.with(imageView.getContext()).load(imageUrl).networkPolicy(NetworkPolicy‌​.NO_CACHE).into(imageView)
bingzai063 2016-04-28
  • 打赏
  • 举报
回复
请问楼主解决了么?遇到了同样的问题,搞了好久了一直没有解决,求回复
qq_19462579 2016-02-02
  • 打赏
  • 举报
回复
楼主解决了么?
大尾巴鹰 2015-11-21
  • 打赏
  • 举报
回复
@LiJun_Zz 好的. 谢了.
=10_01= 2015-11-17
  • 打赏
  • 举报
回复
可以看看官方文档:http://square.github.io/picasso/2.x/picasso/; 楼主重新上传了头像,想重新加载头像一次是吗。 试试:

Uri uri = Uri.parse("http://www.csdn.com/xxx,jpg");
Picasso.with(context).invalidate(uri);
文档里有个 Cache 接口可以研究研究
大尾巴鹰 2015-11-17
  • 打赏
  • 举报
回复
@JochimY 好像不行呀!,这个怎么搞呢?
JochimY 2015-11-16
  • 打赏
  • 举报
回复
试试Picasso.with(getActivity()).invalidate(file);

80,471

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧