/** * Create an instance of {@link Comments } * */ public Comments createComments() { return new Comments(); }
/** * Create an instance of {@link Comments } * */ public Comments createComments() { return new Comments(); }
for (int i = 0; i < jsonArray.length(); i++) { JSONObject entry = jsonArray.getJSONObject(i); JSONObject contentObject = entry.getJSONObject("content"); String content = contentObject.getString("$t"); JSONObject publishedObject = entry.getJSONObject("published"); String published = publishedObject.getString("$t"); JSONArray authorArray = entry.getJSONArray("author"); JSONObject authorObject = authorArray.getJSONObject(0); JSONObject nameObject = authorObject.getJSONObject("name"); String name = nameObject.getString("$t"); comments.add(new Comments(name, content, published)); }
@Override public void onResponse(JSONObject response) { try { JSONArray jsonArray = response.getJSONArray("poi"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); Comments current = new Comments(); current.image = "drawable://" + R.drawable.juandirection_placeholder; current.title = jsonObject.getString("title"); current.comment = jsonObject.getString("comment"); current.date = jsonObject.getString("date"); current.rating = Integer.parseInt(jsonObject.getString("rating")); commentsData.add(current); } // **you may call function and pass the list value to update your ui component. you will get the real size of list here.** } catch (JSONException e) { e.printStackTrace(); } }
}, }); var comments = new Comments();
}, }); var comments = new Comments(); var commentView = new CommentView({ collection: comments