added in version 24.1.0
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1
Summary:
Inherited XML Attrs
| Inherited Constants
| Inherited Fields
| Ctors
| Methods
| Inherited Methods
| [Expand All]
SwitchPreference
public
class
SwitchPreference
extends TwoStatePreference
java.lang.Object | |||
↳ | android.support.v7.preference.Preference | ||
↳ | android.support.v7.preference.TwoStatePreference | ||
↳ | android.support.v14.preference.SwitchPreference |
A Preference
that provides a two-state toggleable option.
This preference will store a boolean into the SharedPreferences.
Summary
Inherited XML attributes | |
---|---|
![]()
android.support.v7.preference.Preference
|
Inherited constants |
---|
![]()
android.support.v7.preference.Preference
|
Inherited fields |
---|
![]()
android.support.v7.preference.TwoStatePreference
|
Public constructors | |
---|---|
SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Construct a new SwitchPreference with the given style options. |
|
SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr)
Construct a new SwitchPreference with the given style options. |
|
SwitchPreference(Context context, AttributeSet attrs)
Construct a new SwitchPreference with the given style options. |
|
SwitchPreference(Context context)
Construct a new SwitchPreference with default style options. |
Public methods | |
---|---|
CharSequence
|
getSwitchTextOff()
|
CharSequence
|
getSwitchTextOn()
|
void
|
onBindViewHolder(PreferenceViewHolder holder)
Binds the created View to the data for this Preference. |
void
|
setSwitchTextOff(int resId)
|