{
"Items": [{
"__type": "Section1:#com.test.example",
"Info": {
}, {
"__type": "Section2:#com.test.example2",
"Allergy": [{
}]
}
}]
}
我如何解析上面的 JSON 对象,以便我得到 Info 项和 Allergy 项....
JSONObject documentRoot = new JSONObject(result);
JSONArray documentChild = documentRoot.getJSONArray("Items");
JSONObject child = null;
for (int i = 0; i < documentChild.length(); i++) {
child = documentChild.getJSONObject(i);
}