user2563494
user2563494

Reputation: 209

setDestinationInExternalPublicDir and getExternalStorageDirectory not equal

In my app, I want download a zip file and unzip it.

In DownloadManager request I use this:

request.setDestinationInExternalPublicDir("/SingingStudio", "file.zip");

This is write file in external storage.

And when I want to access file:

String szip = Environment.getExternalStorageDirectory()+File.separator+"SingingStudio"+File.separator+"file.zip";

This is get file from internal storage. And getExternalStoragePublicDirectory("/") too.

So I can not find the file .

Upvotes: 0

Views: 8252

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006819

Quoting the documentation for setDestinationInExternalPublicDir(), the first parameter is "the directory type to pass to getExternalStoragePublicDirectory(String)". That method, in turn, has a limited set of values it accepts, and "/SingingStudio" is not one of them.

Upvotes: 1

Related Questions