我尝试从Facebook获取相册数据,并使用此方法获取相册封面照片。我得到了以下响应信息:
这是什么意思?我该如何获取图片URL或图片?下面是代码:{Response: responseCode: 200, graphObject: GraphObject{graphObjectClass=GraphObject, state={"FACEBOOK_NON_JSON_RESULT":"����\u0000\u0010JFIF\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0001\u0000\u0000��\u0000�Photoshop"}}, error: null, isFromCache:false}
for(final FbAlbumItem f: albums){
Bundle params = new Bundle();
params.putString("type", "small");
new Request(
Session.getActiveSession(),
"/"+f.getAlbumId()+"/picture",
params,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
Log.i("SocialManager", "" + response);
JSONObject obj = response.getGraphObject().getInnerJSONObject();
try {
JSONObject o = obj.getJSONObject("albums").getJSONObject("data");
String url = o.getString("url");
f.setImageUrl(url);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
).executeAsync();
FbAlbumItem:
字符串 albumId;
字符串 albumName;
字符串 albumCover;
字符串 imageUrl;