1

出于某种原因,即使我几乎完全从示例中复制了这段代码,我似乎也看不到我朋友的任何信息。我正在使用只有几个朋友的假帐户。有人可以告诉我可能出了什么问题吗?

Session.openActiveSession(this, true, new Session.StatusCallback() {
     @Override
     public void call(Session session, SessionState state, Exception exception) {
         if (session.isOpened()) {
         Request.executeMyFriendsRequestAsync(session, new Request.GraphUserListCallback() {
        @Override
    public void onCompleted(List<GraphUser> users, Response response) {
         Log.d("INFO", "on complete");
         Log.i("INFO", "" + users.toString());
4

1 回答 1

1
final Runnable getFacebookUserInfo = new Runnable() {
    @Override
    public void run() {
        Request.executeMeRequestAsync(facebookConnector.getFacebook()
                .getSession(), new Request.GraphUserCallback() {
            @Override
            public void onCompleted(GraphUser user, Response response)
            {
                //...   
            }
        });

        Request.executeMyFriendsRequestAsync(facebookConnector.getFacebook()
                .getSession(), new Request.GraphUserListCallback() {
            @Override
            public void onCompleted(List<GraphUser> users, Response response) {
                if (users != null) {
                    List<String> friendsList = new ArrayList<String>();
                    for (GraphUser user : users) {
                        friendsList.add(user.getId());
                        //...
                    }
                }
            }
        });
}

};

我认为它很有用。

于 2013-05-27T04:44:10.543 回答