xutils下载文件,显示下载失败

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);
                    System.out.println("current:"+current+"/"+total);
                }
                @Override
                public void onSuccess(ResponseInfo<File> arg0) {
                    System.out.println("下载成功");
                }

                @Override
                public void onFailure(HttpException arg0, String arg1) {
                    System.out.println("下载失败");
                }
            });
        }           
    };
    t.start();
}
查看全部
u013171437
还念那个叫春的城市
2015/07/17 12:10
  • xutils
  • ndroid
  • 下载
  • 点赞
  • 收藏
  • 回答
    私信

6个回复