Fresco: how to refresh a drawee with a same uri but not the same image acturally

Created on 23 Nov 2016  路  2Comments  路  Source: facebook/fresco

for example :at first i did :draweeAvatar.setImageURI("avatar.jpg");
then i updated the 'avatar.jpg' to another picture but still named 'avatar.jpg',when i call the method 锛歞raweeAvatar.setImageURI("avatar.jpg"); it would not update,how can i update the bitmap in the draweeAvatar

question

Most helpful comment

There are obviously parts of the image pipeline that make the assumption that a URL will always point to the same resource.

If this isn't possible for you, there are a couple of alternatives that come quickly to mind.

  1. Add a cache-busting query parameter (e.g. avatar.jpg?c=2 where the previous version was 1)
  2. Call draweeAvatar.setImageURI(null) then ImagePipeline.evictFromCache(Uri) before setting the same Uri back to the avatar.

All 2 comments

There are obviously parts of the image pipeline that make the assumption that a URL will always point to the same resource.

If this isn't possible for you, there are a couple of alternatives that come quickly to mind.

  1. Add a cache-busting query parameter (e.g. avatar.jpg?c=2 where the previous version was 1)
  2. Call draweeAvatar.setImageURI(null) then ImagePipeline.evictFromCache(Uri) before setting the same Uri back to the avatar.

I'm closing as there have been no follow-up questions.

Was this page helpful?
0 / 5 - 0 ratings