我使用最新的SDK版本4.9.0 for android。 我想获取我的相册并使用以下代码:
GetUserAlbumsRequestCallback getUserAlbumsRequestCallback = new GetUserAlbumsRequestCallback();
GraphRequest requestUserAlbumsRequest = new GraphRequest(AccessToken.getCurrentAccessToken(), "me",null,null,getUserAlbumsRequestCallback);
Bundle parameters_requestUserAlbumsRequest = new Bundle();
parameters_requestUserAlbumsRequest.putString("fields", "albums.limit(500){id,name,cover_photo,count,photos.limit(500){id,name,picture,source,width,height,images}}");
parameters_requestUserAlbumsRequest.putString("locale", Locale.getDefault().getLanguage());
requestUserAlbumsRequest.setParameters(parameters_requestUserAlbumsRequest);
GraphRequestBatch batch = new GraphRequestBatch(requestUserAlbumsRequest);
batch.addCallback(new GraphRequestBatch.Callback() {
........
}
batch.executeAsync();
然后在GetUserAlbumsRequestCallback类中,
public class GetUserAlbumsRequestCallback implements GraphRequest.Callback {
public void onCompleted(GraphResponse response) {
// the response is not excepted
}
}
以下是回复:
{响应:responseCode:200,graphObject:null,错误:{HttpStatus: -1,errorCode:-1,errorType:null,errorMessage:无法构造请求体}}
但有时我可以获得正确的数据,当我用后退键完成活动,然后用facebook重新输入活动时,它有时显示不正确。
我不知道发生了什么事,你能帮助我吗? 我使用Facebook sdk for android version 4.9.0