2016-10-26 6 views

答えて

3

requestQueueはリクエストのスタックに使用され、キャッシュを処理します。

このRequestQueueは、アプリケーションクラスまたはシングルトンクラスで作成する必要があります。複数のアクティビティから同じrequestQueueを使用することができます。詳細については、次のようにあなたがREQUESTQUEUEを作成

private static RequestQueue mRequestQueue; 

public RequestQueue getRequestQueue() 
{ 
    if (mRequestQueue == null) { 
     Cache cache = new DiskBasedCache(MTXApplication.getAppContext().getCacheDir(), 20 * 1024 * 1024); 
     Network network = new BasicNetwork(new HurlStack()); 
     mRequestQueue = new RequestQueue(cache, network); 
     mRequestQueue.start(); 
    } 
    return mRequestQueue; 

} 

RequestQueue

関連する問題