/*json字符串最外层是大括号时:*/
JSONObject jsonObject = new JSONObject(jsonStr);
/*json字符串最外层是方括号时:*/
JSONArray jsonArray = new JSONArray(jsonStr);
参考文章:
Android-json解析(三):原生JSONObject+JSONArray的解析、遍历及生成等
/*json字符串最外层是大括号时:*/
JSONObject jsonObject = new JSONObject(jsonStr);
/*json字符串最外层是方括号时:*/
JSONArray jsonArray = new JSONArray(jsonStr);
参考文章:
Android-json解析(三):原生JSONObject+JSONArray的解析、遍历及生成等