Android.Test.Mock.MockPackageManager.SetComponentEnabledSetting Method
Set the enabled setting for a package component (activity, receiver, service, provider).

Syntax

[Android.Runtime.Register("setComponentEnabledSetting", "(Landroid/content/ComponentName;II)V", "GetSetComponentEnabledSetting_Landroid_content_ComponentName_IIHandler")]
public override void SetComponentEnabledSetting (Android.Content.ComponentName componentName, [Android.Runtime.GeneratedEnum] Android.Content.PM.ComponentEnabledState newState, [Android.Runtime.GeneratedEnum] Android.Content.PM.ComponentEnableOption flags)

Parameters

componentName
The component 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 component's state to whatever was set in it's manifest (or enabled, by default).
flags
Optional behavior flags: Android.Content.PM.PackageManager.DontKillApp or 0.

Remarks

Set the enabled setting for a package component (activity, receiver, service, provider). This setting will override any enabled state which may have been set by the component in its manifest.

[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