Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在android中使用Graph API获取facebook帖子的所有评论_Android_Json_Facebook - Fatal编程技术网

无法在android中使用Graph API获取facebook帖子的所有评论

无法在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>

我已经创建了与Facebook集成的应用程序,从中获取提要。实际上,我得到了正确的响应,但现在的问题是,我无法使用graph API获得所有评论。假设其中一篇文章有30条评论,而我使用列表视图只得到facebook墙中每篇文章的最后2条评论

请帮我从帖子中获取所有评论。提前谢谢。 这是我使用JSON解析的代码片段

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在应答和链接中描述