HTTPUTILS获取网络数据

private void initEvent(final int i, String path1) {
HttpUtils httpUtils = new HttpUtils();
httpUtils.configCurrentHttpCacheExpiry(0);

    httpUtils.send(HttpMethod.GET, path1, new RequestCallBack() {

        @Override
        public void onFailure(HttpException arg0, String arg1) {

        }

        @Override
        public void onSuccess(ResponseInfo arg0) {
            String result = arg0.result;
            try {
                ByteArrayInputStream stream = new ByteArrayInputStream(
                        result.getBytes("utf-8"));
                List listb = pullXml(stream);
                Message msg = new Message();
                msg.obj = listb;
                msg.arg1 = i;
                handler.sendMessage(msg);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

你可能感兴趣的:(HTTPUTILS获取网络数据)