[英]Get list of Facebook Friends from FriendPickerFragment using SDK 3.5 in Android
I am using Facebook SDK 3.5 and i am a bit confused. 我正在使用Facebook SDK 3.5,我有点困惑。 If i use
FriendPickerFragment
(from their example) it populates the fragment with the list of friends, but I only want to have the JSON or list of GraphUser only. 如果我使用
FriendPickerFragment
(来自他们的示例),它将用朋友列表填充该片段,但是我只想拥有JSON或仅GraphUser列表。
Does anybody know how to get that information using the picker fragment. 是否有人知道如何使用选择器片段来获取该信息。 I don't understand how they get the data to populate the fragment.
我不明白他们如何获取数据来填充片段。
This is how i can see what is selected from the populated list: 这是我可以看到从填充列表中选择的内容的方式:
List<GraphUser> selectedUsers = friendPickerFragment.getSelection();
for (GraphUser selectedUser : selectedUsers) { System.out.println("selectedUser: " + selectedUser);
}
But how can i get the entire list(selected or not)? 但是我如何获得整个列表(是否选中)?
Request request = Request.newMyFriendsRequest(
Session.getActiveSession(),
new Request.GraphUserListCallback() {
@Override
public void onCompleted(List<GraphUser> users, Response response) {
System.out.println("Users: " + users);
}
});
request.executeAsync();
Just make a graph request to me/friends. 只需向我/朋友发送图表请求即可。 The SDK already provides you with a convenience method in Request.newMyFriendsRequest
SDK已在Request.newMyFriendsRequest中为您提供了一种便捷的方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.