使用此代码,我想提取我的朋友列表,下一步是我朋友的所有最后签到,但列表始终为空。
public void onClick(View v) {
String fqlQuery = "SELECT uid,name,pic_square FROM user WHERE uid IN "
+ "(SELECT uid2 FROM friend WHERE uid1 = me() LIMIT 25)";
Bundle params = new Bundle();
params.putString("q", fqlQuery);
Session session = Session.getActiveSession();
Request request = new Request(session, "/fql", params, HttpMethod.GET, new Request.Callback() {
public void onCompleted(Response response) {
Log.i(TAG, "Result: " + response.toString());
try {
GraphObject graphObject = response.getGraphObject();
JSONObject jsonObject = graphObject.getInnerJSONObject();
Log.d("data", jsonObject.toString());
JSONArray array = jsonObject.getJSONArray("data");
System.out.println("länge array" + array.length());
for (int i = 0; i < array.length(); i++) { //
JSONObject friend = array.getJSONObject(i);
Log.d("uid", friend.getString("uid"));
Log.d("name", friend.getString("name"));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
Request.executeBatchAsync(request);
}
});
return view;
}
}
我也想得到我朋友的所有签到,但数据是空的,如果有人可以帮助我,我会很高兴
LogCat 的输出:
{ "data": []}