2018-03-11 使用xutils实现多线程下载

2018-03-13  本文已影响0人  紫杉叶子
笔记如下
        HttpUtils utils = new HttpUtils();
        utils.download("http://~~~~~~~~:8080/ff.exe", "/storage/sdcard/xxx.exe", true, new RequestCallBack<File>() {

            @Override
            public void onLoading(long total, long current, boolean isUploading) {
                super.onLoading(total, current, isUploading);
                System.out.println("正在下载......");
            }


            @Override
            public void onStart() {
                super.onStart();
                System.out.println("开始下载了......");

            }

            //表示成功
            @Override
            public void onSuccess(ResponseInfo<File> responseInfo) {
                System.out.println("下载成功......");
            }

            @Override
            public void onFailure(HttpException error, String msg) {
                System.out.println("下载失败");
            }
        });
上一篇下一篇

猜你喜欢

热点阅读