0

我仍然不明白我的应用程序有什么问题。我使用 DownloadManager 从服务器获取一些 mp3 文件,我想把它放在 /Podcasts 默认的 android 文件夹中,但我做不到。我尝试了不同的方式,但没有成功。如果我使用

Uri destination = Uri.fromFile(new File(Environment.DIRECTORY_PODCASTS));

抛出异常:

java.lang.securityexception destination must be on external storage: file///Podcasts

为什么?

4

1 回答 1

0

you may find this thread useful. Basically, it seems that only system apps are able to reach Media Directory. Whhy don't you just use exgternal directory?

String pathLocalFile = getExternalFilesDir( null ).getPath() 

would return your app's directory on external memory and you can create relevant directories there.

于 2013-11-15T11:01:23.880 回答