无法使用https://github.com/novoda/download-manager将文件保存到特定文件夹

时间:2018-11-26 08:35:32

标签: directory android-download-manager

无法将文件保存到特定文件夹

  

我想将下载的文件保存到// String path = Environment.getExternalStorageDirectory()。getPath()+ File.separator +“ App Name”;但我无法这样做。...你能帮我吗?

字符串路径= Environment.getExternalStorageDirectory()。getPath()+    File.separator +“ appname”;

 Batch batch = Batch.with(new StorageRoot() {
        @Override
        public String path() {
            return path;
        }
    }, DownloadBatchIdCreator.createSanitizedFrom(messageData.getMessage_id()), name)
            .downloadFrom(url).saveTo("download").withIdentifier(DownloadFileIdCreator.createFrom(messageData.getMessage_id())).apply().build();
    manager.download(batch);

lib链接 lib link

0 个答案:

没有答案