SwitchPreference Constructors

Definition

Overloads

SwitchPreference(Context)

Construct a new SwitchPreference with default style options.

SwitchPreference(Context, IAttributeSet)

Construct a new SwitchPreference with the given style options.

SwitchPreference(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

SwitchPreference(Context, IAttributeSet, Int32)

Construct a new SwitchPreference with the given style options.

SwitchPreference(Context, IAttributeSet, Int32, Int32)

Construct a new SwitchPreference with the given style options.

SwitchPreference(Context)

Construct a new SwitchPreference with default style options.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")]
public SwitchPreference (Android.Content.Context? context);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context -> Android.Preferences.SwitchPreference

Parameters

context
Context

The Context that will style this preference

Attributes

Remarks

Construct a new SwitchPreference with default style options.

Java documentation for android.preference.SwitchPreference.SwitchPreference(android.content.Context).

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

SwitchPreference(Context, IAttributeSet)

Construct a new SwitchPreference with the given style options.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")]
public SwitchPreference (Android.Content.Context? context, Android.Util.IAttributeSet? attrs);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context * Android.Util.IAttributeSet -> Android.Preferences.SwitchPreference

Parameters

context
Context

The Context that will style this preference

attrs
IAttributeSet

Style attributes that differ from the default

Attributes

Remarks

Construct a new SwitchPreference with the given style options.

Java documentation for android.preference.SwitchPreference.SwitchPreference(android.content.Context, android.util.AttributeSet).

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

SwitchPreference(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected SwitchPreference (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Preferences.SwitchPreference : nativeint * Android.Runtime.JniHandleOwnership -> Android.Preferences.SwitchPreference

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

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

SwitchPreference(Context, IAttributeSet, Int32)

Construct a new SwitchPreference with the given style options.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "")]
public SwitchPreference (Android.Content.Context? context, Android.Util.IAttributeSet? attrs, int defStyleAttr);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context * Android.Util.IAttributeSet * int -> Android.Preferences.SwitchPreference

Parameters

context
Context

The Context that will style this preference

attrs
IAttributeSet

Style attributes that differ from the default

defStyleAttr
Int32

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

Attributes

Remarks

Construct a new SwitchPreference with the given style options.

Java documentation for android.preference.SwitchPreference.SwitchPreference(android.content.Context, android.util.AttributeSet, int).

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

SwitchPreference(Context, IAttributeSet, Int32, Int32)

Construct a new SwitchPreference with the given style options.

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;II)V", "")]
public SwitchPreference (Android.Content.Context? context, Android.Util.IAttributeSet? attrs, int defStyleAttr, int defStyleRes);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;II)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context * Android.Util.IAttributeSet * int * int -> Android.Preferences.SwitchPreference

Parameters

context
Context

The Context that will style this preference

attrs
IAttributeSet

Style attributes that differ from the default

defStyleAttr
Int32

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

defStyleRes
Int32

A resource identifier of a style resource that supplies default values for the view, used only if defStyleAttr is 0 or can not be found in the theme. Can be 0 to not look for defaults.

Attributes

Remarks

Construct a new SwitchPreference with the given style options.

Java documentation for android.preference.SwitchPreference.SwitchPreference(android.content.Context, android.util.AttributeSet, int, int).

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