Compartir a través de


MockPackageManager.SetApplicationEnabledSetting Method

Definition

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 override void SetApplicationEnabledSetting (string? packageName, Android.Content.PM.ComponentEnabledState newState, Android.Content.PM.ComponentEnableOption flags);
[<Android.Runtime.Register("setApplicationEnabledSetting", "(Ljava/lang/String;II)V", "GetSetApplicationEnabledSetting_Ljava_lang_String_IIHandler")>]
override this.SetApplicationEnabledSetting : string * Android.Content.PM.ComponentEnabledState * Android.Content.PM.ComponentEnableOption -> unit

Parameters

packageName
String

The package name of the application to enable

newState
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).

flags
ComponentEnableOption

Optional behavior flags: DontKillApp or 0.

Attributes

Remarks

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