到目前为止,这是我的代码:
/// after login
Bundle params1 = new Bundle();
params1.putString("fields", "id, name, link");
mAsyncRunner.request("me/albums", params1, new AlbumsRequestListener());
...
public class AlbumsRequestListener extends BaseRequestListener {
@Override
public void onComplete(String response, Object state) {
Log.e("PHOTOS",response);
}
}
然后返回
12-24 18:20:16.738:ERROR / PHOTOS(8170): { “数据”:[{ “ID”: “301187506586589”, “名”: “照片”, “链接”:“http://www.facebook.com/album.php?fbid=301187506586589&id=100000860254064&援助= 65054" , “CREATED_TIME”: “2011-12-24T16:00:09 + 0000”},{ “ID”: “299723973399609”, “名”:“墙 照片 “ ”链接“: ”http://www.facebook.com/album.php?fbid=299723973399609&id=100000860254064&aid=64756“, ”CREATED_TIME“:” 2011-12-21T22:16:53+ 0000 “},{” ID “:” 299722003399806" , “名”:“简介 图片 “ ”链接“: ”http://www.facebook.com/album.php?fbid=299722003399806&id=100000860254064&aid=64755“, ”CREATED_TIME“:” 2011-12-21T22:12:39+ 0000 “}],” 寻呼 “:{” 前面的 “:” https://graph.facebook.com/me/albums?access_token=AAAELP9dblyEBAHgW3q8jkepd16GRnD9iDoGW0rhPYH6LxVa13ccQH6yV9sWyo8k5FBA7m15TnzlyXyIasbltJZC422ox7W34t1drDiQZDZD&format=json&fields=id,+name,+link&limit=25& ;因为= 1324742409&安培; __ paging_token = 301187506586589&安培; __以前= 1" , “下一个”:“https://graph.facebook.com/me/albums?access_token=AAAELP9dblyEBAHgW3q8jkepd16GRnD9iDoGW0rhPYH6LxVa13ccQH6yV9sWyo8k5FBA7m15TnzlyXyIasbltJZC422ox7W34t1drDiQZDZD&format=json&fields=id,+name,+link& ;限制= 25安培;直到= 1324505559&安培; __ paging_token = 299722003399806" }}
现在的问题是 - 如何直接链接到这张照片?我如何提出要求拍照或......好吧,任何想法?
谢谢!
答案 0 :(得分:1)
您应该使用JSONArray
来获取链接和其他内容
JSONArray jArray = new JSONArray(result);
for(int i=0;i<jArray.length();i++){
JSONObject json_data = jArray.getJSONObject(i);
Log.i("log_tag"," "+json_data.getString("link"));
}
祝你好运:)