語言

LauncherApps.IsActivityEnabled(ComponentName, UserHandle) 方法

定義

檢查活動是否存在,並且是否啟用了個人檔案。

[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

參數

component
ComponentName

活動要檢查。

user
UserHandle

該設定檔的使用者暱稱。

傳回

如果該活動存在且已啟用,則為 true。

屬性

備註

檢查活動是否存在,並且是否啟用了個人檔案。

活動可能仍未匯出, #startMainActivity 若呼叫者與目標應用程式的 UID 相同,否則會拋出 a SecurityException 。

如果該使用者是隱藏設定檔 UserManager#USER_TYPE_PROFILE_PRIVATE,呼叫者應該擁有正常 android.Manifest.permission#ACCESS_HIDDEN_PROFILES 權限和該 android.app.role.RoleManager#ROLE_HOME 角色。

Java 文件 android.content.pm.LauncherApps.isActivityEnabled(android.content.ComponentName, android.os.UserHandle)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於