Volley Image Caching

后端 未结 7 2046
臣服心动
臣服心动 2020-12-09 18:18

I am trying to understand Volley\'s image caching. I have a fragment with gridview inside it, which will load around 12-30 images. There images are retrieved from server and

7条回答
  •  抹茶落季
    2020-12-09 18:53

    Are you using Volley as a singleton? If you're not, and you're not using a common context for the requestQueue, it won't work the way you expect. The documentation on this part of Volley is particularly unhelpful (at least since I used it last). Once configured properly it will read/write from the cache as you would expect.

    Here is a GitHub project with a VolleySingleton class you can use along with examples: CypressNorth/Volley-Singleton

    Here is a blog post describing the setup in more detail: Setting up the Android Google Volley ImageLoader for NetworkImageView

提交回复
热议问题