您的位置:首页 > 移动开发 > Objective-C

java.lang.String cannot be converted to JSONObject

2017-12-19 09:02 936 查看
待解析字符串 jsonStr;

JsonObject object=new JsonObject(jsonStr);


运行代码后异常

org.json.JSONException: Value 20171218141710_0001.MP4,THM ,LRV,20971520 at 0 of type java.lang.String cannot be converted to JSONObject


也是头回遇到,解决方法

if(jsonStr.startsWith(“\ufeff”)){

jsonStr= jsonStr.substring(1);

}

加载解析之前就可以

参考 http://blog.csdn.net/eclothy/article/details/51850491
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android json
相关文章推荐