zoukankan      html  css  js  c++  java
  • 使用Xutils(HttpUtils)请求网络数据


                HttpUtils utils = new HttpUtils();
                utils.send(HttpMethod.POST, urls[i] + 1,
                        new RequestCallBack<String>() {

                            @Override
                            public void onFailure(HttpException arg0, String arg1) {
                                // TODO Auto-generated method stub

                            }

                            @Override
                            public void onSuccess(ResponseInfo<String> arg0) {

    //解析数据
                                String result = arg0.result;
                                 if (i == 0 || i == 1) {

                                    XStream stream = new XStream();
                                    stream.processAnnotations(Super1.class);

                                    Super1 super1 = (Super1) stream.fromXML(result);
                                    List<News> list = super1.getNewslist()
                                            .getNews();
                                    System.out.println("集合:" + list);

                                }
                                if (i == 2 || i == 3) {

                                }

                            }
                        });
           

  • 相关阅读:
    韩国新地图格式
    这次是真的准备出售用于传奇开发的HGE图形引擎了
    减小Delphi2010程序的尺寸(关闭RTTI反射机制)
    hook api 保护进程
    使用静态库
    iOS中的Block动画
    IOS中忽略字符串两边空格比较
    判断是否输入有汉字
    EasyDSS产生cache缓存如何设定定时清理缓存?
    EasyDSS定制项目中ETCD服务挂掉如何设定定时重启?
  • 原文地址:https://www.cnblogs.com/weiyangge/p/5352987.html
Copyright © 2011-2022 走看看