0
中使用Graph API獲取所有關於Facebook牆貼的評論我已經創建了我的與Facebook集成的應用程序以獲取源。我確實得到了正確的答覆,但現在的問題是我無法使用圖形API獲取所有評論。假設其中一個帖子有30條評論,而我只使用列表視圖獲取每個帖子在facebook牆上的最後2條評論。無法在android
請幫我看看帖子中的所有評論。提前致謝。 這是我使用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);
}
}