android fastjson 解析

时间:2021-04-16 08:23:55
JSONObject jsonObject = JSON.parseObject(wsResponse);
String recommends = jsonObject.getString("recommends"); Log.i("ss","__________________________recommends:"+recommends);
List<Recommend> contents = JSON.parseArray(recommends, Recommend.class);
Log.i("ss","____________________________contents.size:"+contents.size()); 注意:
1:是Integer不是int
2:是implements Serializable,不是implements Serializable, Parcelable
public class Recommend implements Serializable {

    private Integer mediaId;
private String title;
private Integer timeSpan;
private Integer roomId;
private String roomName;
private Integer gameId;
private Float overallScore;
private Integer scoreType;
private Integer totalViews;
private Integer definition;
private String createTime; }