2

i have listview to load images for alot of users and this listview item has an imageview for profile picture of user, the problem here if the user changed his the new image will not be shown as last profile picture is cached and the old one will be displayed because the new and old image have the same url: URL EX: "https://xyz.s3.amazonaws.com/users/" + friend_id + "/photos/profile.jpg"

i used Glide but i have the same problem

Sam Judd
  • 7,317
  • 1
  • 38
  • 38
Mina Farid
  • 5,041
  • 4
  • 39
  • 46

1 Answers1

2

This issue is because of the cache of images, Glide checks if image is available in cache, if it does glide loads it else it would load the new image.

To solve this issue you need to change its cache strategy like this

Glide.with(mContext)
            .load((Integer) mDataset.get(position))
            .fitCenter()
            .diskCacheStrategy(DiskCacheStrategy.NONE) // this will prevent image to be cached and each time glide will load it from server
            .into(imageView);
Atiq
  • 14,435
  • 6
  • 54
  • 69