如何使用 Gson 解析 JSON 对象内的多个 JSON 数组?
{
"id": 1,
"Data": {
"Details": [{
"Code": "1",
"Name": "John"
}, {
"Code": "2",
"Name": "Peter"
}],
"Other": [{
"age": "56",
"gender": "M"
}, {
"age": "66",
"gender": "M"
}]
},
"message": "SUCCESS"
}
任何帮助,将不胜感激。
Simple!
JSONObject jsonObj = new JSONObject(yourStringHere).optJSONObject("Data");
JSONArray jsonDetail = jsonObj.optJSONArray("Details");
JSONArray jsonOther = jsonObj.optJSONArray("Other");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)