问题
I am downloading a file from the web to my Android device using DownloadManager
. I am saving this file on the sdcard using:
DownloadManager.Request req = new DownloadManager.Request(Uri.parse("file path"));
req.setTitle("file title").setDescription("Downloading ....") // download the package at the /sdcard/download path.
.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "file name"+ "file extension");
I want to save it to the internal storage. How to do that?
回答1:
use this path .setDestinationInExternalPublicDir(Environment.getExternalStorageDirectory()
+"/Android/data/xxx.xxx.xxx/files/")
来源:https://stackoverflow.com/questions/11340853/android-download-file-from-internet-using-downloadmanager-and-save-it-to-the-in