更新时间:2021-11-11 21:57:52
我假设您从完整的JSONObject开始,但是如果要使用横幅配置数组,则可以跳过第一行.
I'm assuming you are starting with the full JSONObject but you can skip the first line if you've for the banner configurations array.
JSONObject data = [insert something following your structure above];
JSONArray bannerConfigurations = data.get("BannerConfigurations");
for (int i=0; i<bannerConfigurations.length(); i++) {
JSONObject device = bannerConfigurations.getJSONObject(i);
String deviceType = device.getString("deviceType");
int id = device.getInt("id");
// do stuff!
}