MockContext.GrantUriPermission(String, Uri, ActivityFlags) 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.
Grant permission to access a specific Uri to another package, regardless of whether that package has general permission to access the Uri's content provider.
[Android.Runtime.Register("grantUriPermission", "(Ljava/lang/String;Landroid/net/Uri;I)V", "GetGrantUriPermission_Ljava_lang_String_Landroid_net_Uri_IHandler")]
public override void GrantUriPermission (string? toPackage, Android.Net.Uri? uri, Android.Content.ActivityFlags modeFlags);
[<Android.Runtime.Register("grantUriPermission", "(Ljava/lang/String;Landroid/net/Uri;I)V", "GetGrantUriPermission_Ljava_lang_String_Landroid_net_Uri_IHandler")>]
override this.GrantUriPermission : string * Android.Net.Uri * Android.Content.ActivityFlags -> unit
Parameters
- toPackage
- String
The package you would like to allow to access the Uri.
- uri
- Uri
The Uri you would like to grant access to.
- modeFlags
- ActivityFlags
The desired access modes. Any combination of GrantReadUriPermission, GrantWriteUriPermission, Android.Content.Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, or Android.Content.Intent.FLAG_GRANT_PREFIX_URI_PERMISSION.
- Attributes
Remarks
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.