當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestBatch類代碼示例

本文整理匯總了Java中com.facebook.RequestBatch的典型用法代碼示例。如果您正苦於以下問題:Java RequestBatch類的具體用法?Java RequestBatch怎麽用?Java RequestBatch使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RequestBatch類屬於com.facebook包,在下文中一共展示了RequestBatch類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import com.facebook.RequestBatch; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
    r1 = new Request(null, "4");
    r2 = new Request(null, "4");

    progressMap = new HashMap<Request, RequestProgress>();
    progressMap.put(r1, new RequestProgress(null, r1));
    progressMap.get(r1).addToMax(5);
    progressMap.put(r2, new RequestProgress(null, r2));
    progressMap.get(r2).addToMax(5);

    requests = new RequestBatch(r1, r2);

    ByteArrayOutputStream backing = new ByteArrayOutputStream();
    stream = new ProgressOutputStream(backing, requests, progressMap, MAX_PROGRESS);
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:17,代碼來源:ProgressOutputStreamTests.java

示例2: startLoading

import com.facebook.RequestBatch; //導入依賴的package包/類
private void startLoading(Request request, boolean skipRoundtripIfCached, long afterDelay) {
    this.skipRoundtripIfCached = skipRoundtripIfCached;
    appendResults = false;
    nextRequest = null;
    currentRequest = request;
    currentRequest.setCallback(new Request.Callback() {
        @Override
        public void onCompleted(Response response) {
            requestCompleted(response);
        }
    });

    // We are considered loading even if we have a delay.
    loading = true;

    final RequestBatch batch = putRequestIntoBatch(request, skipRoundtripIfCached);
    Runnable r = new Runnable() {
        @Override
        public void run() {
            Request.executeBatchAsync(batch);
        }
    };
    if (afterDelay == 0) {
        r.run();
    } else {
        Handler handler = new Handler();
        handler.postDelayed(r, afterDelay);
    }
}
 
開發者ID:yeloapp,項目名稱:yelo-android,代碼行數:30,代碼來源:GraphObjectPagingLoader.java

示例3: testCreateNonemptyRequestBatch

import com.facebook.RequestBatch; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCreateNonemptyRequestBatch() {
    Request meRequest = Request.newMeRequest(null, null);

    RequestBatch batch = new RequestBatch(new Request[] { meRequest, meRequest });
    assertEquals(2, batch.size());
    assertEquals(meRequest, batch.get(0));
    assertEquals(meRequest, batch.get(1));
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:12,代碼來源:BatchRequestTests.java


注:本文中的com.facebook.RequestBatch類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。