android fastjson 解析

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;

}
posted @ 2015-07-17 16:46  wanqi  阅读(493)  评论(0编辑  收藏  举报