//相关包
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;

// code 
JsonParser jsonparer = new JsonParser();
JsonElement je = null;
je = jsonparer.parse(strResult); // strData为Json字符串
Object ob = je.getAsJsonObject().get("data"); // 获取Json中的 "data"子对象
Gson gson = new Gson();
List<TestPojo> picInfoList = gson.fromJson(ob.toString(), // List<TestPojo> 需要转成的结果泛型
  new TypeToken<List<TestPojo>>(){}.getType());

 

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-13
  • 2021-12-27
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案