I'm new to json with java and I have a json that looks like this:
[{
"color": red,
"numbers": [
"8967",
"3175",
"1767"
],
}, {
"color": blue,
"numbers": [
"1571",
"5462",
"54"
]
}]
And code to try and extract the colors and numbers:
while(i<jsonArray.size()){
JSONObject object = (JSONObject) jsonArray.get(i);
colors = object.get("color");
numbers.add(object.get("numbers");
The colors get extracted fine but my problem is I am trying to extract the numbers and place them 1 by 1 in an array but instead of placing them like this:
numbers[0]="8967"
numbers[1]="3175"
they get placed like this:
numbers[0]={"8967","3175","1767"}
How can I get them placed 1 by 1 as above?