Request request = new Request(Uri.parse(URL_ADDRESS));
request.setAllowedNetworkTypes(3);
request.setTitle((CharSequence)"Download");
request.setDescription((CharSequence)"The file is downloading..");
request.allowScanningByMediaScanner();
request.setNotificationVisibility(1);
//File is saving to "Download"
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
FILE_NAME+FILE_EXTENSION);
在互联网上挖掘之后,我找到了我的问题的答案。
所需方法:
request.setDestinationInExternalPublicDir(directory, filename);例子: