RestrictionsManager.RequestPermission Method

Definition

Called by an application to request permission for an operation.

[Android.Runtime.Register("requestPermission", "(Ljava/lang/String;Ljava/lang/String;Landroid/os/PersistableBundle;)V", "GetRequestPermission_Ljava_lang_String_Ljava_lang_String_Landroid_os_PersistableBundle_Handler")]
public virtual void RequestPermission (string? requestType, string? requestId, Android.OS.PersistableBundle? request);
[<Android.Runtime.Register("requestPermission", "(Ljava/lang/String;Ljava/lang/String;Landroid/os/PersistableBundle;)V", "GetRequestPermission_Ljava_lang_String_Ljava_lang_String_Landroid_os_PersistableBundle_Handler")>]
abstract member RequestPermission : string * string * Android.OS.PersistableBundle -> unit
override this.RequestPermission : string * string * Android.OS.PersistableBundle -> unit

Parameters

requestType
String

The type of request. The type could be one of the predefined types specified here or a custom type that the specific Restrictions Provider might understand. For custom types, the type name should be namespaced to avoid collisions with predefined types and types specified by other Restrictions Providers.

requestId
String

A unique id generated by the app that contains sufficient information to identify the parameters of the request when it receives the id in the response.

request
PersistableBundle

A PersistableBundle containing the data corresponding to the specified request type. The keys for the data in the bundle depend on the request type.

Attributes

Exceptions

if any of the required parameters are missing.

Remarks

Called by an application to request permission for an operation. The contents of the request are passed in a Bundle that contains several pieces of data depending on the chosen request type.

Java documentation for android.content.RestrictionsManager.requestPermission(java.lang.String, java.lang.String, android.os.PersistableBundle).

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