共用方式為


PackageManager.CheckPermission(String, String) Method

Definition

Check whether a particular package has been granted a particular permission.

[Android.Runtime.Register("checkPermission", "(Ljava/lang/String;Ljava/lang/String;)I", "GetCheckPermission_Ljava_lang_String_Ljava_lang_String_Handler")]
public abstract Android.Content.PM.Permission CheckPermission (string permName, string packageName);
[<Android.Runtime.Register("checkPermission", "(Ljava/lang/String;Ljava/lang/String;)I", "GetCheckPermission_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member CheckPermission : string * string -> Android.Content.PM.Permission

Parameters

permName
String

The name of the permission you are checking for.

packageName
String

The name of the package you are checking against.

Returns

If the package has the permission, PERMISSION_GRANTED is returned. If it does not have the permission, PERMISSION_DENIED is returned.

Attributes

Remarks

Check whether a particular package has been granted a particular permission.

Java documentation for android.content.pm.PackageManager.checkPermission(java.lang.String, java.lang.String).

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