猿问

android 开发中 json解析问题出错啊

{"msg":1,"msgbox":"返回歌手分类!","data":"[ { "rownum":"11","id":"1047","userName":"敖日格勒","picurl":"mobile1_1047_head.jpg"}, { "rownum":"12","id":"1046","userName":"敖根","picurl":"mobile1_1046_head.jpg"}, { "rownum":"13","id":"1045","userName":"阿拉腾孙德尔","picurl":"mobile1_1045_head.jpg"}, { "rownum":"14","id":"1044","userName":"阿拉腾松布尔","picurl":"mobile1_1044_head.jpg"}, { "rownum":"15","id":"1043","userName":"哈斯格组合","picurl":"mobile1_1043_head.jpg"}, { "rownum":"16","id":"1042","userName":"金花儿","picurl":"mobile1_1042_head.JPG"}, { "rownum":"17","id":"1041","userName":"李胜男","picurl":"mobile1_1041_head.jpg"}, { "rownum":"18","id":"1040","userName":"赵丹丹","picurl":"mobile1_1040_head.jpg"}, { "rownum":"19","id":"1039","userName":"张震宇","picurl":"mobile1_1039_head.jpg"}, { "rownum":"20","id":"1038","userName":"张晓燕","picurl":"mobile1_1038_head.jpg"}, { "rownum":"21","id":"1037","userName":"永胜","picurl":"mobile1_1037_head.jpg"} ]"}

JSONObject jsonObj = new JSONObject(strtest)
strtest就是上面的json格式字符串
就报错 json格式不对么。。。。
org.json.JSONException: Unterminated object at character 42 of。。。
JSONArray jsonObjs = new JSONObject(strtest).getJSONArray("data");


九州编程
浏览 633回答 3
3回答

Cats萌萌

"data":"[改成:"data":[ 同样结尾的"也去掉

慕娘9325324

谢谢了。 非常感谢。
随时随地看视频慕课网APP

相关分类

Java
我要回答