如何使用 Facebook SDK获取所有 facebook 朋友的状态。这是我的代码,但是返回错误。
Request r = Request.newMyFriendsRequest(Session.getActiveSession(),
new Request.GraphUserListCallback() {
@Override
public void onCompleted(List users,
Response response) {
try{
GraphObject graphObject = response.getGraphObject();
JSONObject jsonObject = graphObject.getInnerJSONObject();
Log.d("data", jsonObject.toString(0));
JSONArray array = jsonObject.getJSONArray("data");
for(int i=0;i<array.length();i++){
JSONObject friend = array.getJSONObject(i);
}
}catch(JSONException e){
e.printStackTrace();
}
}
});
Bundle params = r.getParameters();
params.putString("fields", "name,statuses.limit(5)");
r.setParameters(params);
r.executeAsync();