1

我会使用 Android sdk 3.0 beta 从 facebook 获得用户喜欢。

我该怎么做呢?

4

1 回答 1

10

如果您有一个有效的会话,这是获得用户喜欢的代码

    Session session = Session.getActiveSession();
    Request.Callback callback = new Request.Callback() {

        @Override
        public void onCompleted(Response response) {
            // response should have the likes
            Toast.makeText(getApplicationContext(), response.toString(), Toast.LENGTH_LONG).show();
        }
    };
    Request request = new Request(session, "me/likes", null, HttpMethod.GET, callback);
    RequestAsyncTask task = new RequestAsyncTask(request);
    task.execute();
于 2012-11-08T21:12:04.227 回答