Here's the relevant part of my json file:
"categories": [
[
"Belgian Restaurant",
"belgian"
],
[
"Brasserie",
"brasseries"
]
],
What i want to do is retrieve informations from the second JSONArray
(let's say "brasseries" for example).
The following code worked for retrieving informations from the first array:
JSONArray categories = jsonObject.getJSONArray("categories");
restaurant.setCat1(categories.getJSONArray(0).getString(1));
The result of this was "belgian" as expected, but then i tryed the same for the second array:
restaurant.setCat2(categories.getJSONArray(1).getString(1));
and that threw a Index 1 out of range [0..1)
JSONException
I don't get it since indexes 0 and 1 clearly exist in the file ... Why would 0 work and not 1 ?