HttpUtils网络请求

来源:互联网 发布:360mac版下线 编辑:程序博客网 时间:2024/05/21 05:38
public void getTitleInfo1() {// 网络请求数据HttpUtils httpUtils = new HttpUtils();String path = "请求网址";httpUtils.send(HttpMethod.GET, path, new RequestCallBack<String>() {@Overridepublic void onFailure(HttpException arg0, String arg1) {}@Overridepublic void onSuccess(ResponseInfo<String> info) {String result = info.result;// gson解析Gson gson = new Gson();//HpViewPagerBean  bean包HpViewPagerBean fromJson = gson.fromJson(result,HpViewPagerBean.class);ad1BeanList.addAll(fromJson.data.ad1);//跟新适配器  适配器de操作
}});}


0 0
原创粉丝点击