我使用此代码下载并保存到 sdcard下载文件夹
Uri Download_Uri = Uri.parse(link);
DownloadManager.Request request = new DownloadManager.Request(Download_Uri);
request.setAllowedOverRoaming(false);
request.setMimeType(exe);
String pathToExternalStorage = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
request.setDestinationUri(Uri.fromFile(new File(pathToExternalStorage + "file.mp3")));
downloadManager.enqueue(request);
下载完成后,在音频文件夹
中创建备份文件如何预防此行动?
注意:如果从Download
文件夹中删除此文件,则保留Audio
文件夹