Android.Test.Mock.MockPackageManager.SetApplicationEnabledSetting 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.

Syntax

[Android.Runtime.Register("setApplicationEnabledSetting", "(Ljava/lang/String;II)V", "GetSetApplicationEnabledSetting_Ljava_lang_String_IIHandler")]
public override void SetApplicationEnabledSetting (string packageName, [Android.Runtime.GeneratedEnum] Android.Content.PM.ComponentEnabledState newState, [Android.Runtime.GeneratedEnum] Android.Content.PM.ComponentEnableOption flags)

Parameters

packageName
The package name of the application to enable
newState
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
Optional behavior flags: Android.Content.PM.PackageManager.DontKillApp or 0.

Remarks

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. It also overrides the enabled state set in the manifest for any of the application's components. It does not override any enabled state set by Android.Content.PM.PackageManager.SetComponentEnabledSetting(Android.Content.ComponentName, Android.Content.PM.ComponentEnabledState, Android.Content.PM.ComponentEnabledState) for any of the application's components.

[Android Documentation]

Requirements

Namespace: Android.Test.Mock
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1