MediaStore.GetDocumentUri(Context, 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.
Return a DocumentsProvider Uri that is an equivalent to the given
MediaStore Uri.
[Android.Runtime.Register("getDocumentUri", "(Landroid/content/Context;Landroid/net/Uri;)Landroid/net/Uri;", "", ApiSince=26)]
public static Android.Net.Uri? GetDocumentUri(Android.Content.Context context, Android.Net.Uri mediaUri);
[<Android.Runtime.Register("getDocumentUri", "(Landroid/content/Context;Landroid/net/Uri;)Landroid/net/Uri;", "", ApiSince=26)>]
static member GetDocumentUri : Android.Content.Context * Android.Net.Uri -> Android.Net.Uri
Parameters
- context
- Context
- mediaUri
- Uri
The MediaStore Uri to convert.
Returns
An equivalent DocumentsProvider Uri. Returns null
if no equivalent was found.
- Attributes
Remarks
Return a DocumentsProvider Uri that is an equivalent to the given MediaStore Uri.
This allows apps with Storage Access Framework permissions to convert between MediaStore and DocumentsProvider Uris that refer to the same underlying item. Note that this method doesn't grant any new permissions; callers must already hold permissions obtained with Intent#ACTION_OPEN_DOCUMENT or related APIs.
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.