{
"terms": [{
"offset": 0,
"value": "Nerkundram"
}, {
"offset": 12,
"value": "Chennai"
}, {
"offset": 21,
"value": "Tamil Nadu"
}, {
"offset": 33,
"value": "India"
}]
}
答案 0 :(得分:2)
使用此:
try{
JSONObject json = new JSONObject(jsonString);
JSONArray jsonArray = json.getJSONArray("terms");
for(int i=0;i<jsonArray.length();i++){
JSONObject object = jsonArray.getJSONObject(i);
String offset = object.getString("offset");
String value = object.getString("value");
//rest of the strings..
}
}
catch (JSONException e){
e.printStackTrace();
}