我使用的下载管理器,当我使用Android的下载管理器setDestinationInExternalFilesDir
setDestinationInExternalFilesDir(this, Environment.DIRECTORY_DOWNLOADS, "example.ext");
的文件被下载到Android /数据/ com.example.app /文件/ Download文件夹。
当我尝试
setDestinationInExternalPublicDir("/folder", "example.ext");
我得到: IllegalStateException: Cannot create directory mnt/sdcard/folder
。 我也设置了WRITE_EXTERNAL_STORAGE权限。
我在做什么错?
我尝试以下。 downloadRequest.setDestinationInExternalFilesDir(v.getContext(),folder,down.getTitle()+“。epub”)); 但该文件被下载到 file:///mnt/sdcard/Android/data/com.example.app/files/*folder-path* –
我暂时通过从Android/data/com.example.app/files到我需要的目录。 –