Made a request to the server. It returns the answer:
{ "response": { "count": 462409, "items": [ { "message": { "id": 552885, "date": 1376054836, "out": 0, "user_id": 185014513, "read_state": 0, "title": " ... ", "body": "test" } } ] } } Using this code, I get to message and write the contents to the arraylist:
try { JSONObject jsonObject = (JSONObject) response.json.get("response"); JSONArray jsonArray = (JSONArray) jsonObject.get("items"); for (int i = 0; i<jsonArray.length();i++){ JSONObject name = (JSONObject) jsonArray.get(i); arrayList.add(name.getString("message")); How can I refer to the title contained within the message and write its contents to arrayList? Thank.