限制请求图表上的结果

时间:2012-10-22 02:50:22

标签: android facebook facebook-graph-api

我正在使用面向Android 3.0的Facebook SDK,我想要做的就是获得10张朋友的照片。如何将limit参数添加到请求中?

for (GraphUser user : users) {
  Request request = Request.newGraphPathRequest(
    session,user.getId()+"/photos",new Request.Callback(){...});

  //requests is a collection of requests
  requests.add(request);
}
Request.executeBatchAsync(requests);

1 个答案:

答案 0 :(得分:5)

要为朋友只拍摄10张照片,请执行以下操作:

    Bundle params = new Bundle();
    params.putString("limit", "10");
    request.setParameters(params);

    requests.add(request);
}