I'm trying to clear the cache memory of Picasso via Android coding.
Can anyone please help me in this issue..?
I have tried using the following code, but this was not useful in my case:
Picasso.with(getActivity()).load(data.get(pos).getFeed_thumb_image()).skipMemoryCache().into(image);
Instead of clearing the complete cache if one wants to refresh the image with the given Uri. try this
Picasso.with(context).invalidate(uri);
it internally removes the key from the cache maintained by Picasso.When activity destroy, unfortunately bitmap was not recycled if we're using Picasso. I try to programmatically recycle bitmap, what's loaded in to image view. There is a way to reference to loaded bitmap by using
Target
.And when Activity destroy, I call
onBitmapFailed(null)
to recycle loaded bitmap.But remember, DON'T CACHE IMAGE IN MEMORY by this case, It will cause Use recycled bitmap exception.
Hope this help.