无法在android中使用Graph API获取facebook帖子的所有评论
我已经创建了与Facebook集成的应用程序,从中获取提要。实际上,我得到了正确的响应,但现在的问题是,我无法使用graph API获得所有评论。假设其中一篇文章有30条评论,而我使用列表视图只得到facebook墙中每篇文章的最后2条评论 请帮我从帖子中获取所有评论。提前谢谢。 这是我使用JSON解析的代码片段无法在android中使用Graph API获取facebook帖子的所有评论,android,json,facebook,Android,Json,Facebook,我已经创建了与Facebook集成的应用程序,从中获取提要。实际上,我得到了正确的响应,但现在的问题是,我无法使用graph API获得所有评论。假设其中一篇文章有30条评论,而我使用列表视图只得到facebook墙中每篇文章的最后2条评论 请帮我从帖子中获取所有评论。提前谢谢。 这是我使用JSON解析的代码片段 childList=new ArrayList<HashMap<String,Object>>(); HashMap<String, Object>
childList=new ArrayList<HashMap<String,Object>>();
HashMap<String, Object> childlist_hashMap=new HashMap<String, Object>();
JSONObject comments_Show=data.getJSONObject(i).getJSONObject("comments");
if(comments_Show.has("data"))
{
JSONArray datacomments=comments_Show.getJSONArray("data");
for(int c=0;c<datacomments.length();c++) {
childlist_hashMap=new HashMap<String, Object>();
childlist_hashMap.put("UserName", datacomments.getJSONObject(c).getJSONObject("from").getString("name"));
URL url= new URL("http://graph.facebook.com/"+datacomments.getJSONObject(c).getJSONObject("from").getString("id")+"/picture?type=normal");
childlist_hashMap.put("Image", BitmapFactory.decodeStream(url.openConnection().getInputStream()));
childlist_hashMap.put("CommentsFull",datacomments.getJSONObject(c).getString("message"));
childlist_hashMap.put("Comments_id",datacomments.getJSONObject(c).getString("id"));
childlist_hashMap.put("Comments_date",datacomments.getJSONObject(c).getString("created_time"));
childList.add(childlist_hashMap);
}
}
childList=newarraylist();
HashMap childlist_HashMap=新HashMap();
JSONObject comments_Show=data.getJSONObject(i).getJSONObject(“comments”);
如果(注释显示有(“数据”))
{
JSONArray datacomments=comments_Show.getJSONArray(“数据”);
例如(int c=0;c我经常听说Facebook GraphApi没有提供足够的信息
我建议您使用FQL,更低级的方法来获取数据。
FQL在应答和链接中描述