use of im.amomo.volley.OkNetwork in project OkVolley by googolmo.
the class OkVolley method newRequestQueue.
public static RequestQueue newRequestQueue(Context context) {
if (InstanceNetwork == null) {
InstanceNetwork = new OkNetwork(getDefaultHttpStack());
}
if (InstanceCache == null) {
File cache = context.getExternalCacheDir();
if (cache == null) {
cache = context.getCacheDir();
}
File cacheDir = new File(cache, DEFAULT_CACHE_DIR);
InstanceCache = new DiskBasedCache(cacheDir);
}
RequestQueue queue = new RequestQueue(InstanceCache, InstanceNetwork);
queue.start();
return queue;
}
Aggregations