I have a JSON like this:
{
"Output": [
{
"Description": "Desc1",
"Amount": 40,
"TotalQuota": 40,
"QuotaPerOne": 2
},
{
"Description": "Desc2",
"Amount": 50,
"TotalQuota": 60,
"QuotaPerOne": 3
}
]
}
I try to get the value of column "Description" of the above 2 items, and put in a Arraylist by the code below:
try{
JSONArray output = importData.getJSONArray("Output");
ArrayList<String>Title = new ArrayList<String>();
for(int i=0;i<output.length();i++) {
String bookingInfo = output.getJSONObject(i).toString();
bookingList.add(bookingInfo);
}
}catch (Exception e) {
System.out.println(e.toString());
}
But I only get the whole column of item1 and item2. My expect result is to put "Desc1","Desc2" into ArrayList Title, please help!