Volley give me Out of memory exception after I make a lot of request with big amount of data

白昼怎懂夜的黑 提交于 2019-12-05 18:36:29

How do you initialize your RequestQueue? I suspect that you are creating RequestQueues for each tab. If that's the case, change your program to use one common instance of RequestQueue from all the tabs. You need to initialize and retain it in your activity and add requests to it from each tab.

I used static queue instead of creating new queue in my Record class

I changed code from

public class Record {

    private RequestQueue RecordSyncQueue = Volley.newRequestQueue(ImonaAndroidApp.app);

}

to

public class Record {

    private static RequestQueue RecordSyncQueue = Volley.newRequestQueue(ImonaAndroidApp.app);

}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!