Android: runtime-error 'Unable to create directory', on use of class DownloadManager, method setDestinationInExternalPublicDir

拥有回忆 提交于 2019-11-28 12:30:11

The problem is in

Unable to create directory: /mnt/sdcard/Download

Try this:

String name = Environment.getExternalStorageDirectory().getAbsolutePath();

name += "/YourDirectoryName/" ;

Do you have the proper permissions in your Manifest ?

See WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions

Rajat Trivedi

I think you didn't give a sd card size when you crated the emulator.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!