您当前的位置: 首页 >  android

ZhangJiQun&MXP

暂无认证

  • 0浏览

    0关注

    1187博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Android 文件下载

ZhangJiQun&MXP 发布时间:2021-06-28 16:18:16 ,浏览量:0

Android 文件下载
       String url = Config.ImagePath + UserInfoSP.getHeaderImageUrl(mcontext);
            String path = MainActivity.this.getFilesDir().getAbsolutePath() + File.separator + SAVE_IMG_DIR + "/1.jpg";
            new Thread(new Runnable() {
                @Override
                public void run() {
                    File file = null;
                    try {
                        file = Glide.with(MainActivity.this)
                                .load(url)
                                .downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
                                .get();
                    } catch (ExecutionException e) {
                        e.printStackTrace();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    if (file!=null){
                        FileUtil.copy(fi
关注
打赏
1665659684
查看更多评论
立即登录/注册

微信扫码登录

0.0797s