解析jsonObject

JSONObject data = jsonObject.getJSONObject("data");
Gson gson = new Gson();
Type type = new TypeToken<Bean>(){}.getType();
Bean bean = gson.fromJson(String.valueOf(data), type);

解析JSONArray 

JSONArray array = jsonObject.getJSONArray("data");
Gson gson = new Gson();
Type type = new TypeToken<List<Bean>>() {}.getType();
List list = gson.fromJson(String.valueOf(array), type);

 

相关文章:

  • 2021-06-13
  • 2022-12-23
  • 2022-01-12
  • 2021-06-23
  • 2021-07-05
  • 2022-12-23
  • 2021-06-11
猜你喜欢
  • 2021-10-07
  • 2021-11-21
  • 2022-02-05
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案