private void getinfo() {
String path = "http://mnews.gw.com.cn/wap/data/news/xbsjxw/page_1.json";
NetGetData.getinfo(getActivity(), path, new GetInterFace() {
@Override
public void go(String json) {
JSONArray jsonArray = null;
try {
jsonArray = new JSONArray(json);
String s = jsonArray.get(0).toString();
Gson gson = new Gson();
Data data = gson.fromJson(s, Data.class);
List<Data.DataBean> data1 = data.getData();
Log.d("--","数据"+data1.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
解析json文件
最新推荐文章于 2024-05-06 21:00:07 发布