DownloadManager.Request.SetDestinationUri(Uri) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Set the local destination for the downloaded file.
[Android.Runtime.Register("setDestinationUri", "(Landroid/net/Uri;)Landroid/app/DownloadManager$Request;", "GetSetDestinationUri_Landroid_net_Uri_Handler")]
public virtual Android.App.DownloadManager.Request? SetDestinationUri(Android.Net.Uri? uri);
[<Android.Runtime.Register("setDestinationUri", "(Landroid/net/Uri;)Landroid/app/DownloadManager$Request;", "GetSetDestinationUri_Landroid_net_Uri_Handler")>]
abstract member SetDestinationUri : Android.Net.Uri -> Android.App.DownloadManager.Request
override this.SetDestinationUri : Android.Net.Uri -> Android.App.DownloadManager.Request
Parameters
- uri
- Uri
Uri: a file Uri indicating the destination for the downloaded file.
Returns
this object
- Attributes
Remarks
Set the local destination for the downloaded file. The destination must be a file URI for a path on external storage. The calling application may need the WRITE_EXTERNAL_STORAGE permission, depending on its target version and destination. From Android 3.0 through Android 9, allowScanningByMediaScanner() requests media scanning. Starting in Android 10, allowScanningByMediaScanner() is ignored; files in app-owned directories are not scanned, and other files are eligible for scanning. By default, downloads are saved to a generated filename in the shared download cache and may be deleted by the system at any time to reclaim space. For applications targeting Build.VERSION_CODES.Q or above, WRITE_EXTERNAL_STORAGE permission is not needed and the URI must refer to a path within the directories owned by the application (e.g. Context.getExternalFilesDir(String)) or a path within the top-level Downloads directory (as returned by Environment.getExternalStoragePublicDirectory(String) with Environment.DIRECTORY_DOWNLOADS). All non-visible downloads that are not modified in the last 7 days will be deleted during idle runs.
Android reference for android.app.DownloadManager.Request.setDestinationUri.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.