gson解析比较方便、代码量少、方便;
gson解析之解析集合:
Gson gson = new Gson();gson解析类:
Type type = new TypeToken<ArrayList<Topic>>() {
}.getType();
List<Topic> topics = gson.fromJson(s, type);
Gson gson= GsonBuilderUtil.create();
PersonInfo personInfo=gson.fromJson(S,PersonInfo.class);
gson解析(集合、字符串等)
Gson gson = GsonBuilderUtil.create();
LaunchTopic topics = gson.fromJson(S,LaunchTopic.class);
public class LaunchTopic {
private List<Topic> topics;
private int state;
private String s;
}