【发布时间】:2014-01-06 11:04:14
【问题描述】:
class A {
RequestQueue mRequestQueue ;
public void onCreate(Bundle saveInstance){
mRequestQueue = Volley.newRequestQueue(context);
//Reuqest Call for JsonObject
mRequestQueue.add(new JsonObjectRequest(Method.GET, _filterUri, null, new Listener<JSONObject>() {
public void onResponse(JSONObject jObj) {
try { // a little bit code using jObj } catch (Exception e) {
e.printStackTrace();
}
}
}....//and error repsone listener as well.
}
因此,我确实将 RequestQueue 与活动上下文一起保存。在 RequestQueue 命中时,总是得到一个文件,将我的调用和 jsonObject 存储在 App Cache 中,如图所示。正如我点击 RequestQueue 一样,Volley 将文件存储在缓存中。
- 为什么 Volley 将每个文件都存储在缓存中而不是删除?
- 根据 Activity 上下文调用 RequestQueue 时我做错了吗?
- 我使用这个 volley 缓存消耗了大量内存,是吗??
- 如何使用 volley 优化我的 http 调用?
【问题讨论】:
标签: java android json caching android-volley