out of memory issue with volley's disk cache

后端 未结 2 989
青春惊慌失措
青春惊慌失措 2021-02-06 08:52

In my app for Android I\'m using Volley for loading images in custom listview.

when i refresh(delete all items and load tiems) listview many times, my app is killed with

2条回答
  •  深忆病人
    2021-02-06 09:43

    Have you tried

    RequestQueue volleyQueue = Volley.newRequestQueue(this);
    DiskBasedCache cache = new DiskBasedCache(getCacheDir(), 16 * 1024 * 1024);
    volleyQueue = new RequestQueue(cache, new BasicNetwork(new HurlStack()));
    volleyQueue.start();
    

    from

    https://stackoverflow.com/a/21299261/3399432

    This changes the cache size

提交回复
热议问题