想要计算 monthly_engagement_info 中的总OBJECTS,它有2个对象,但我想按计算进行计数。
{
"status": {
"monthly_engagement_info": [
{
"ride_description_title": "Home Address",
"ride": "Home"
},
{
"ride_description_title": "Home Address"
}
]
}
}
答案 0 :(得分:2)
String response="you response";
JSONObject object=new JSONObject(response);
JSONArray arrayInfo=object.getJSONArray("monthly_engagement_info");
Log.d(" size of info"," size= "+arrayInfo.length()); // here get size