json 异常

 

com.google.gson.JsonSyntaxException: 1530842820000

1530842820000 是服务器直接返回的Date值由 Gson 解析后出来的值。

  后台发出:

  前台接收到的JSON数据:

 

后台Date前端String接接好了,gson 解析时默认用int 类型 标识这个值,但是超过int可以表示的最大值了。所以Android端改为String去标识这个数值。

解决方式:

private Date startDate; 
private Date endDate;

---》 Date改为String

  com.google.gson.stream.MalformedJsonException

 com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

 

posted @ 2018-07-09 17:18  javakam  阅读(541)  评论(0编辑  收藏  举报