android download manager download to external removable sd card -


i tried use android download manager download file.

request.setdestinationinexternalpublicdir("/myfile", "abc.txt"); enqueue = dm.enqueue(request);           

so file downloaded /storage/sdcard/myfile/abc.txt.

however, external removal sd card, path /storage/sdcard1/.

request.setdestinationinexternalpublicdir 

defaults /storage/sdcard/.

how can set download path /storage/sdcard1/myfile/abc.txt?

use setdestination instead. example. change environment.getexternalstoragedirectory() hardcoded path.

file root = new file(environment.getexternalstoragedirectory() + file.separator); uri path = uri.withappendedpath(uri.fromfile(root), "this_is_downloaded_file.png"); request.setdestinationuri(path); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -