本文整理汇总了Java中com.android.volley.ExecutorDelivery类的典型用法代码示例。如果您正苦于以下问题:Java ExecutorDelivery类的具体用法?Java ExecutorDelivery怎么用?Java ExecutorDelivery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExecutorDelivery类属于com.android.volley包,在下文中一共展示了ExecutorDelivery类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newVolleyRequestQueueForTest
import com.android.volley.ExecutorDelivery; //导入依赖的package包/类
private RequestQueue newVolleyRequestQueueForTest(final Context context) {
File cacheDir = new File(context.getCacheDir(), "cache/volley");
Network network = new BasicNetwork(new HurlStack());
ResponseDelivery responseDelivery = new ExecutorDelivery(Executors.newSingleThreadExecutor());
RequestQueue queue = new RequestQueue(new DiskBasedCache(cacheDir), network, 4, responseDelivery);
queue.start();
return queue;
}
示例2: newRequestQueue
import com.android.volley.ExecutorDelivery; //导入依赖的package包/类
/**
* 自定义Volley请求Queue
*
* @param context Context
* @return RequestQueue
*/
public RequestQueue newRequestQueue(Context context) {
File cacheDir = new File(context.getCacheDir(), DEFAULT_CACHE_DIR);
Network network = new BasicNetwork(new HurlStack());
RequestQueue queue = new RequestQueue(new DiskBasedCache(cacheDir),
network,
DEFAULT_NETWORK_THREAD_POOL_SIZE,
new ExecutorDelivery(executorService));
queue.start();
return queue;
}
示例3: WaspTest
import com.android.volley.ExecutorDelivery; //导入依赖的package包/类
public WaspTest() throws Exception {
File cacheDir = new File(context.getCacheDir(), "volley");
Network network = new BasicNetwork(new OkHttpStack(new OkHttpClient()));
ResponseDelivery delivery = new ExecutorDelivery(executor);
requestQueue = new RequestQueue(new DiskBasedCache(cacheDir), network, 4, delivery);
requestQueue.start();
server.start();
}
示例4: SmartRequestQueue
import com.android.volley.ExecutorDelivery; //导入依赖的package包/类
/**
* Creates the worker pool. Processing will not begin until {@link #start()} is called.
*
* @param cache A Cache to use for persisting responses to disk
* @param network A Network interface for performing HTTP requests
* @param threadPoolSize Number of network dispatcher threads to create
*/
public SmartRequestQueue(Cache cache, Network network, int threadPoolSize) {
this(cache, network, threadPoolSize,
new ExecutorDelivery(new Handler(Looper.getMainLooper())));
}