Compartir a través de


MockPackageManager.SetComponentEnabledSetting Method

Definition

Set the enabled setting for a package component (activity, receiver, service, provider).

[Android.Runtime.Register("setComponentEnabledSetting", "(Landroid/content/ComponentName;II)V", "GetSetComponentEnabledSetting_Landroid_content_ComponentName_IIHandler")]
public override void SetComponentEnabledSetting (Android.Content.ComponentName? componentName, Android.Content.PM.ComponentEnabledState newState, Android.Content.PM.ComponentEnableOption flags);
[<Android.Runtime.Register("setComponentEnabledSetting", "(Landroid/content/ComponentName;II)V", "GetSetComponentEnabledSetting_Landroid_content_ComponentName_IIHandler")>]
override this.SetComponentEnabledSetting : Android.Content.ComponentName * Android.Content.PM.ComponentEnabledState * Android.Content.PM.ComponentEnableOption -> unit

Parameters

componentName
ComponentName

The component 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 component's state to whatever was set in it's 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