gson list 反序列化

自己记录一下

Gson g = new Gson();
String[] sss= {"1","22","sss"};
String jsonString = g.toJson(sss);
List<String> groups = g.fromJson(jsonString, new TypeToken<List<String>>() {}.getType());

相关推荐