ListPreference
open class ListPreference : DialogPreference
kotlin.Any | |||
↳ | androidx.preference.Preference | ||
↳ | androidx.preference.DialogPreference | ||
↳ | androidx.preference.ListPreference |
A Preference
that displays a list of entries as a dialog.
This preference saves a string value. This string will be the value from the setEntryValues(CharSequence[])
array.
Summary
Nested classes | |
---|---|
A simple |
Inherited constants | |
---|---|
Public constructors | |
---|---|
<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int) |
|
<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int) |
|
<init>(context: Context!, attrs: AttributeSet!) |
|
Public methods | |
---|---|
open Int |
findIndexOfValue(value: String!) Returns the index of the given value (in the entry values array). |
open Array<CharSequence!>! |
The list of entries to be shown in the list in subsequent dialogs. |
open CharSequence! |
getEntry() Returns the entry corresponding to the current value. |
open Array<CharSequence!>! |
Returns the array of values to be saved for the preference. |
open CharSequence! | |
open String! |
getValue() Returns the value of the key. |
open Unit |
setEntries(entries: Array<CharSequence!>!) Sets the human-readable entries to be shown in the list. |
open Unit |
setEntries(@ArrayRes entriesResId: Int) |
open Unit |
setEntryValues(entryValues: Array<CharSequence!>!) The array to find the value to save for a preference when an entry from entries is selected. |
open Unit |
setEntryValues(@ArrayRes entryValuesResId: Int) |
open Unit |
setSummary(summary: CharSequence!) |
open Unit |
Sets the value of the key. |
open Unit |
setValueIndex(index: Int) Sets the value to the given index from the entry values. |
Protected methods | |
---|---|
open Any! |
onGetDefaultValue(a: TypedArray!, index: Int) |
open Unit |
onRestoreInstanceState(state: Parcelable!) |
open Parcelable! |