java.lang.String cannot be converted to JSONObject

来源:互联网 发布:淘宝的账号管理在哪里 编辑:程序博客网 时间:2024/06/16 21:30

待解析字符串 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

阅读全文
0 0