Sto usando il Download Manager e quando usoAndroid Download Manager setDestinationInExternalFilesDir
setDestinationInExternalFilesDir(this, Environment.DIRECTORY_DOWNLOADS, "example.ext");
i file vengono scaricati ad Android com.example.app/file della cartella/data// Download.
Quando provo
setDestinationInExternalPublicDir("/folder", "example.ext");
ottengo: IllegalStateException: Cannot create directory mnt/sdcard/folder
. Ho impostato anche il permesso WRITE_EXTERNAL_STORAGE.
Cosa sto sbagliando?
Ho provato quanto segue. downloadRequest.setDestinationInExternalFilesDir (v.getContext(), cartella, down.getTitle() + ". Epub")); Ma il file viene scaricato nel file : ///mnt/sdcard/Android/data/com.example.app/files/*folder-path* –
L'ho risolto temporaneamente spostando il file dopo aver scaricato da Android/dati/com.example.app/file nella directory che ho richiesto. –