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. Through Android 9, AllowScanningByMediaScanner() requests media scanning. Starting in Android 10, that method is ignored; the system determines whether to scan the file from its destination. Files in app-owned external directories and the shared download cache are not scanned. 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. On Android 10 and later, paths in the calling app's external directories (such as GetExternalFilesDir(String)) and known public directories (such as DirectoryDownloads) do not require WRITE_EXTERNAL_STORAGE. Other paths can require permission or be rejected, depending on the target version and storage policy. During idle maintenance, the system can remove finished non-visible downloads, whether successful or failed, that have not been modified for at least 7 days.
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.