【1】json 转换成Bean對象:
ProductBean productBean = new Gson().fromJson(oneProductResponse.toString(), ProductBean.class);
【2】json 转换成List集合:
List<ProductBean> mProductBeanList = (List<ProductBean>)
new Gson().fromJson(productResponse.toString(),
new TypeToken<List<ProductBean>>() {
}.getType());
网友评论