为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

九州编程 2019-04-19 14:15:58
{"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");
查看完整描述

3 回答

?
Cats萌萌

TA贡献1805条经验 获得超9个赞

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

查看完整回答
反对 回复 2019-05-06
?
慕娘9325324

TA贡献1783条经验 获得超4个赞

谢谢了。 非常感谢。


查看完整回答
反对 回复 2019-05-06
  • 3 回答
  • 0 关注
  • 632 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信