Volley slow and causing memory leak

前端 未结 3 1338
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 13:08

In my project, I am using volley to download a JSON stream which I parse and show in a listview. I use the following method to load my data:

private void lo         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 13:46

    Every call to the method you create a new RequestQueue which is not a recommended approach. You should create one RequestQueue, probably a publicly visible singleton that is initialized once when the app is created.

    Try moving the RequestQueue outside and see if it solves your problem.

提交回复
热议问题