1、json字符串转list 集合
Gson gson = new Gson();
if (!TextUtils.isEmpty(localContact)) {
selectSortDtes = gson.fromJson(localContact, new TypeToken<List<ContactEntity.InfosBean.ListBean>>() {
}.getType());
}
localContact是JSON类型的字符串
2、list集合转json字符串
Gson gson = new Gson();
String tempContact = gson.toJson(selectSortDtes);
这里的gson最好是定义成全局变量