{
"error": false,
"company_data": [
{
"company": {
"details": [
{}
],
"product": [
{}
]
}
}
]
}
答案 0 :(得分:0)
JSONObject object = new JSONObject(jsonString);
if(object.has("error"))
答案 1 :(得分:0)
JSONObject jsonObject = new JSONObject(output);
JsonArray array = jsonObject.getJsonArray("company_data");
if(array.length()!=0)
{
for(int i =0;i<array.length;i++)
{
JSONObject company = array.getJSONObject("company");
JSONArray detailArray = company.getJsonArray("details");
if(detailArray,length()!0)
{
//do Something
}
else
{
//array Empty
}
}
}