haiはこれを参照してくださいあなたはアイデアを得るでしょう
try {
resp = new JSONObject(shared);
cities = new JSONArray(resp.getString("cities"));
for (int i = 0; i < cities.length(); i++) {
JSONObject jsonObject = cities.getJSONObject(i);
id = jsonObject.getString("id");
operators = jsonObject.getJSONArray("operators");
if (id.equalsIgnoreCase(String.valueOf(srcid1))) {
for (int j = 0; j < operators.length(); j++) {
JSONObject jsonObject1 = operators.getJSONObject(j);
oid = jsonObject1.getString("id");
vehicle = jsonObject1.getJSONArray("vehicles");
if (oid.equalsIgnoreCase(value)) {
Log.v("json", "msg");
for (int k = 0; k < vehicle.length(); k++) {
jsonObject2 = vehicle.getJSONObject(k);
vehiclename = jsonObject2.getString("name");
id = jsonObject2.getString("id");
int vehicleid = Integer.parseInt(id);
map = new HashMap<String, String>();
Log.v("vehi", "" + vehiclename);
Log.v("vehi", "" + vehicleid);
map.put("id", "" + id);
map.put("vehiclename", "" + vehiclename);
mylist.add(map);
Log.v("count", "" + mylist.toString());
}
}
}
}
}