I need to parse a JSON with two arrays.
resp: {"attending": [], "people": []}
I tried this
JSONObject AttendingArray = new JSONObject(resp);
JSONArray ParkArray = new JSONArray("people");
JSONArray AttendingArray = new JSONArray("attending");
But it doesn’t work
12-01 22:47:53.074: WARN/System.err(30814): org.json.JSONException: Value people of type java.lang.String cannot be converted to JSONArray
Thanks!
You must pass actual JSON to the
JSONArrayconstructor, not just the name of the json array – thenew JSONArrayconstructor call doesn’t know about the response, so you need to give it some data, not just “people”