Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android JsonParseException:将JSON源解析为JSON失败_Android - Fatal编程技术网

Android JsonParseException:将JSON源解析为JSON失败

Android JsonParseException:将JSON源解析为JSON失败,android,Android,我遇到Json解析异常 Type collectionType = new TypeToken<ArrayList<CGNotifications>>(){}.getType(); Notifications =gson.fromJson(result,collectionType); 对于Json,您的Json包含非utf8字符。 最近的省略号 如果删除它,它将被编译。您发布的JSON源代码格式不正确,只需在源代码之前添加属性名即可。它将正常运行。 所以你的新来源将是

我遇到Json解析异常

Type collectionType = new TypeToken<ArrayList<CGNotifications>>(){}.getType();
Notifications =gson.fromJson(result,collectionType);

对于Json,您的Json包含非utf8字符。 最近的省略号


如果删除它,它将被编译。

您发布的JSON源代码格式不正确,只需在源代码之前添加属性名即可。它将正常运行。 所以你的新来源将是

    newSource = " { \"propertyName\" : " + oldSource + " } ";
它将正常工作。

:签出以下链接。
    newSource = " { \"propertyName\" : " + oldSource + " } ";