Udostępnij za pośrednictwem


LauncherApps.IsPackageEnabled(String, UserHandle) Method

Definition

Checks if the package is installed and enabled for a profile.

[Android.Runtime.Register("isPackageEnabled", "(Ljava/lang/String;Landroid/os/UserHandle;)Z", "GetIsPackageEnabled_Ljava_lang_String_Landroid_os_UserHandle_Handler")]
public virtual bool IsPackageEnabled (string? packageName, Android.OS.UserHandle? user);
[<Android.Runtime.Register("isPackageEnabled", "(Ljava/lang/String;Landroid/os/UserHandle;)Z", "GetIsPackageEnabled_Ljava_lang_String_Landroid_os_UserHandle_Handler")>]
abstract member IsPackageEnabled : string * Android.OS.UserHandle -> bool
override this.IsPackageEnabled : string * Android.OS.UserHandle -> bool

Parameters

packageName
String

The package to check.

user
UserHandle

The UserHandle of the profile.

Returns

true if the package exists and is enabled.

Attributes

Remarks

Checks if the package is installed and enabled for a profile.

Java documentation for android.content.pm.LauncherApps.isPackageEnabled(java.lang.String, android.os.UserHandle).

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