Advertisement
colmulhall

Untitled

Apr 2nd, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. List<Map<String, String>> eventList = new ArrayList<Map<String, String>>();
  2. try
  3. {
  4.     JSONObject jsonResponse = new JSONObject(jsonResult);
  5.     JSONArray jsonMainNode = jsonResponse.optJSONArray("event_list");
  6.          
  7.     // get all of the records returned from the query
  8.     for (int i = 0; i < jsonMainNode.length(); i++)
  9.     {
  10.         JSONObject jsonChildNode = jsonMainNode.getJSONObject(i);
  11.             String title = jsonChildNode.optString("title");  //get the event title from the result set
  12.                    
  13.         eventList.add(createEvent("Event", title));  //add a new event to the list with its title
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement