PackageManager.SetApplicationEnabledSetting(String, ComponentEnabledState, ComponentEnableOption) PackageManager.SetApplicationEnabledSetting(String, ComponentEnabledState, ComponentEnableOption) Method


Set the enabled setting for an application This setting will override any enabled state which may have been set by the application in its manifest.

[Android.Runtime.Register("setApplicationEnabledSetting", "(Ljava/lang/String;II)V", "GetSetApplicationEnabledSetting_Ljava_lang_String_IIHandler")]
public abstract void SetApplicationEnabledSetting (string packageName, Android.Content.PM.ComponentEnabledState newState, Android.Content.PM.ComponentEnableOption flags);
abstract member SetApplicationEnabledSetting : string * Android.Content.PM.ComponentEnabledState * Android.Content.PM.ComponentEnableOption -> unit


String String

The package name of the application to enable

ComponentEnabledState ComponentEnabledState

The new enabled state for the component. The legal values for this state are: Android.Content.PM.PackageManager.COMPONENT_ENABLED_STATE_ENABLED, Android.Content.PM.PackageManager.COMPONENT_ENABLED_STATE_DISABLED and Android.Content.PM.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT The last one removes the setting, thereby restoring the applications's state to whatever was set in its manifest (or enabled, by default).

ComponentEnableOption ComponentEnableOption

Optional behavior flags: DontKillApp or 0.


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