Google is committed to advancing racial equity for Black communities. See how.

SwitchPreference

open class SwitchPreference : TwoStatePreference
kotlin.Any
   ↳ androidx.preference.Preference
   ↳ androidx.preference.TwoStatePreference
   ↳ androidx.preference.SwitchPreference

A Preference that provides a two-state toggleable option.

This preference will save a boolean value to android.content.SharedPreferences.

Summary

Inherited constants
Public constructors
<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Construct a new SwitchPreference with the given style options.

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Construct a new SwitchPreference with the given style options.

<init>(context: Context!, attrs: AttributeSet!)

Construct a new SwitchPreference with the given style options.

<init>(context: Context!)

Construct a new SwitchPreference with default style options.

Public methods
open CharSequence!

open CharSequence!

open Unit

open Unit

Set the text displayed on the switch widget in the off state.

open Unit

Set the text displayed on the switch widget in the off state.

open Unit

Set the text displayed on the switch widget in the on state.

open Unit

Set the text displayed on the switch widget in the on state.

Inherited functions