try {
JSONObject me = new JSONObject(facebook.request("me"));
String id = me.getString("id");
String name = me.getString("name");
System.out.println("Id: " + id + " ---- " + name);
}catch(Exception ex) {
System.out.println(ex);
}
如何获取用户数据资料?
感谢您!
前提是你登录了。
AsyncFacebookRunner myAsyncRunner = new AsyncFacebookRunner(facebook);
myAsyncRunner.request("me", new meRequestListener());
请求监听器:
public class meRequestListener implements RequestListener() {
@Override
public void onComplete(String response, Object state) {
//response is your JSON response
}
//You also have to override all the other methods
}