public void download(View v){
EditText et_url = (EditText) findViewById(R.id.et_url);
String url = et_url.getText().toString().trim();
//1.创建httpUtils对象
HttpUtils httpUtils = new HttpUtils();
//2.调用download方法 url:下载的地址 target:下载的目录 callback:回调
httpUtils.download(url, "/sdcard/feiqiu/feiq.exe", new RequestCallBack
@Override
public void onLoading(long total, long current, boolean isUploading) {
System.out.println("total:"+total+";current:"+current);
super.onLoading(total, current, isUploading);
}
@Override
public void onSuccess(ResponseInfo
System.out.println(responseInfo.result);
}
@Override
public void onFailure(HttpException error, String msg) {
// TODO Auto-generated method stub
}
});
}
手机扫一扫
移动阅读更方便
你可能感兴趣的文章