-4
{ 「錯誤」 嵌套JSON數組:空, 「InternalError該」:空, 「IsSuccessful」:真實, 「消息」:空, 「分行」: { 「 ID「:1, 」名稱「: 」XYZ「, 」歲月「: { 」ID「:6, 」年「: 」2015年至2016年「 } ] } ] }如何分析android的
{ 「錯誤」 嵌套JSON數組:空, 「InternalError該」:空, 「IsSuccessful」:真實, 「消息」:空, 「分行」: { 「 ID「:1, 」名稱「: 」XYZ「, 」歲月「: { 」ID「:6, 」年「: 」2015年至2016年「 } ] } ] }如何分析android的
JSONObject mainObj = new JSONOBject("Your Response");
if(mainObj != null){
JSONArray list = mainObj.getJSONArray("Branches");
if(list != null){
for(int i = 0; i < list.length();i++){
JSONObject elem = list.getJSONObject(i);
if(elem != null){
JSONArray prods = elem.getJSONArray("Years");
if(prods != null){
//Your Code here
}
}
}
}
}
你在用什麼Volly,Retrofit ?? .....你試過什麼? –
使用正常的http客戶端.. – Ravi
mdDroid的波紋管答案是正確的..與它。 –