我使用毕加索在Android应用程序加载图像从网址,但我看到图像不更新时,我更新图像在网络上。毕加索不加载更新的图像从Web在Android
Picasso.with(context).load("http://testServer.com/Images/sponsor.png").into(imageView1);
在此先感谢。
我使用毕加索在Android应用程序加载图像从网址,但我看到图像不更新时,我更新图像在网络上。毕加索不加载更新的图像从Web在Android
Picasso.with(context).load("http://testServer.com/Images/sponsor.png").into(imageView1);
在此先感谢。
毕加索内置缓存,使图像自动缓存。尝试无效。 例如:
Picasso.with(getActivity()).invalidate(file);
试过这个不行的 – Ashok
@Ashok:尝试:Picasso.with(getActivity())。invalidate(“file:”+ imageFile.getAbsolutePath());这对我有效。 –
public void loadImage(ImageView imageView, String image_url,Contextcontext)
{
try
{
Picasso.with(context)
.load(image_url)
.memoryPolicy(MemoryPolicy.NO_CACHE)
.networkPolicy(NetworkPolicy.NO_CACHE)
.placeholder(R.drawable.default_image)
.into(imageView);
}
catch(Exception ex)
{
ex.toString();
}
}
你能为你的代码添加一点解释吗? –
看到,因为毕加索内置CACH如此看来,从兑现其读数。尝试添加Picasso.with(getActivity())。invalidate(file);并告诉我发生什么事 – Moudiz