笔记如下
- 首先导入xUtils-2.6.14.jar
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("下载失败");
}
});
-
download()参数列表
2018-03-11_090007.png
网友评论