Partager via


ContentResolver.TakePersistableUriPermission(Uri, ActivityFlags) Method

Definition

Take a persistable URI permission grant that has been offered.

[Android.Runtime.Register("takePersistableUriPermission", "(Landroid/net/Uri;I)V", "GetTakePersistableUriPermission_Landroid_net_Uri_IHandler")]
public virtual void TakePersistableUriPermission (Android.Net.Uri uri, Android.Content.ActivityFlags modeFlags);
[<Android.Runtime.Register("takePersistableUriPermission", "(Landroid/net/Uri;I)V", "GetTakePersistableUriPermission_Landroid_net_Uri_IHandler")>]
abstract member TakePersistableUriPermission : Android.Net.Uri * Android.Content.ActivityFlags -> unit
override this.TakePersistableUriPermission : Android.Net.Uri * Android.Content.ActivityFlags -> unit

Parameters

uri
Uri
modeFlags
ActivityFlags
Attributes

Remarks

Take a persistable URI permission grant that has been offered. Once taken, the permission grant will be remembered across device reboots. Only URI permissions granted with Intent#FLAG_GRANT_PERSISTABLE_URI_PERMISSION can be persisted. If the grant has already been persisted, taking it again will touch UriPermission#getPersistedTime().

Java documentation for android.content.ContentResolver.takePersistableUriPermission(android.net.Uri, int).

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.

Applies to

See also