-1

I am having trouble understanding how can I loop through a JSONArray like this one----- [ {"A": "a", "X": "x"}, {"A": "a1", "X": "x1"}, {"A": "a2", "X": "x2"} {"A": "a3", "X": "x3"} ] Any help would be greatly appreciated.

1 Answers1

0
JSONArray a = ...;
for (int i = 0; i < a.length(); i++) {
    JSONObject o = a.getJSONObject(i);
    // do something with o
}
Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441