1

I have albumID,I did the following code but not able to get the result (photos). I think m missing something in facebook.request

try {
             //wallAlbumID is variable having album id.
        response = facebook.request("me/album."+wallAlbumID+"/photos");
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    JSONObject json = null;
    try {
        json = Util.parseJson(response);
    } catch (FacebookError e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    JSONArray photos = null;
    try {
        photos = json.getJSONArray("data");
    } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    for (int i =0; i < photos.length(); i++) {
        JSONObject a = null;
        try {
            a = photos.getJSONObject(i);
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }  

looking for code in response.

4

1 回答 1

2

如果您已经知道您的专辑 ID,则无需添加me/albums/到您的请求中。尝试这个:

response = facebook.request(wallAlbumID+"/photos");
于 2012-06-26T00:11:28.463 回答