Udostępnij za pośrednictwem


LauncherApps.IsActivityEnabled(ComponentName, UserHandle) Method

Definition

Checks if the activity exists and it enabled for a profile.

[Android.Runtime.Register("isActivityEnabled", "(Landroid/content/ComponentName;Landroid/os/UserHandle;)Z", "GetIsActivityEnabled_Landroid_content_ComponentName_Landroid_os_UserHandle_Handler")]
public virtual bool IsActivityEnabled (Android.Content.ComponentName? component, Android.OS.UserHandle? user);
[<Android.Runtime.Register("isActivityEnabled", "(Landroid/content/ComponentName;Landroid/os/UserHandle;)Z", "GetIsActivityEnabled_Landroid_content_ComponentName_Landroid_os_UserHandle_Handler")>]
abstract member IsActivityEnabled : Android.Content.ComponentName * Android.OS.UserHandle -> bool
override this.IsActivityEnabled : Android.Content.ComponentName * Android.OS.UserHandle -> bool

Parameters

component
ComponentName

The activity to check.

user
UserHandle

The UserHandle of the profile.

Returns

true if the activity exists and is enabled.

Attributes

Remarks

Checks if the activity exists and it enabled for a profile.

The activity may still not be exported, in which case #startMainActivity will throw a SecurityException unless the caller has the same UID as the target app's.

Java documentation for android.content.pm.LauncherApps.isActivityEnabled(android.content.ComponentName, 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