public void click(View v){
Thread t = new Thread(){
@Override
public void run() {
String path = "http://10.0.2.2:8080/mobilesafe_2.0.apk";
String target = Environment.getExternalStorageDirectory()+ "/update.apk";
HttpUtils utils = new HttpUtils();
utils.download(path, target, new RequestCallBack<File>() {
@Override
public void onLoading(long total, long current, boolean isUploading) {
super.onLoading(total, current, isUploading);
}
@Override
public void onSuccess(ResponseInfo<File> arg0) {
System.out.println("下载成功");
}
@Override
public void onFailure(HttpException arg0, String arg1) {
System.out.println("下载失败");
}
});
}
};
t.start();