Activity.OnRequestPermissionsResult 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.
Overloads
OnRequestPermissionsResult(Int32, String[], Permission[]) |
Callback for the result from requesting permissions. |
OnRequestPermissionsResult(Int32, String[], Permission[], Int32) |
Callback for the result from requesting permissions. |
OnRequestPermissionsResult(Int32, String[], Permission[])
Callback for the result from requesting permissions.
[Android.Runtime.Register("onRequestPermissionsResult", "(I[Ljava/lang/String;[I)V", "GetOnRequestPermissionsResult_IarrayLjava_lang_String_arrayIHandler", ApiSince=23)]
public virtual void OnRequestPermissionsResult (int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults);
[<Android.Runtime.Register("onRequestPermissionsResult", "(I[Ljava/lang/String;[I)V", "GetOnRequestPermissionsResult_IarrayLjava_lang_String_arrayIHandler", ApiSince=23)>]
abstract member OnRequestPermissionsResult : int * string[] * Android.Content.PM.Permission[] -> unit
override this.OnRequestPermissionsResult : int * string[] * Android.Content.PM.Permission[] -> unit
Parameters
- requestCode
- Int32
The request code passed in #requestPermissions
.
- permissions
- String[]
The requested permissions. Never null.
- grantResults
- Permission[]
The grant results for the corresponding permissions which is either
android.content.pm.PackageManager#PERMISSION_GRANTED
or
android.content.pm.PackageManager#PERMISSION_DENIED
. Never null.
- Attributes
Remarks
Callback for the result from requesting permissions. This method is invoked for every call on #requestPermissions
<strong>Note:</strong> It is possible that the permissions request interaction with the user is interrupted. In this case you will receive empty permissions and results arrays which should be treated as a cancellation.
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
OnRequestPermissionsResult(Int32, String[], Permission[], Int32)
Callback for the result from requesting permissions.
[Android.Runtime.Register("onRequestPermissionsResult", "(I[Ljava/lang/String;[II)V", "GetOnRequestPermissionsResult_IarrayLjava_lang_String_arrayIIHandler", ApiSince=35)]
public virtual void OnRequestPermissionsResult (int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults, int deviceId);
[<Android.Runtime.Register("onRequestPermissionsResult", "(I[Ljava/lang/String;[II)V", "GetOnRequestPermissionsResult_IarrayLjava_lang_String_arrayIIHandler", ApiSince=35)>]
abstract member OnRequestPermissionsResult : int * string[] * Android.Content.PM.Permission[] * int -> unit
override this.OnRequestPermissionsResult : int * string[] * Android.Content.PM.Permission[] * int -> unit
Parameters
- requestCode
- Int32
The request code passed in #requestPermissions
.
- permissions
- String[]
The requested permissions. Never null.
- grantResults
- Permission[]
The grant results for the corresponding permissions which is either
android.content.pm.PackageManager#PERMISSION_GRANTED
or
android.content.pm.PackageManager#PERMISSION_DENIED
. Never null.
- deviceId
- Int32
The deviceId for which permissions were requested. The primary/physical
device is assigned Context#DEVICE_ID_DEFAULT
, and virtual devices
are assigned unique device Ids.
- Attributes
Remarks
Callback for the result from requesting permissions. This method is invoked for every call on #requestPermissions
.
<strong>Note:</strong> It is possible that the permissions request interaction with the user is interrupted. In this case you will receive empty permissions and results arrays which should be treated as a cancellation.
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.