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 array.

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet, defStyleAttr: Int)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)
constructor(@NonNull context: Context)

Functions

Link copied to clipboard
open fun findIndexOfValue(value: String): Int
Returns the index of the given value (in the entry values array).
Link copied to clipboard
The list of entries to be shown in the list in subsequent dialogs.
Link copied to clipboard
Returns the entry corresponding to the current value.
Link copied to clipboard
Returns the array of values to be saved for the preference.
Link copied to clipboard
Returns the summary of this preference.
Link copied to clipboard
open fun getValue(): String
Returns the value of the key.
Link copied to clipboard
open fun setEntries(@ArrayRes entriesResId: Int)

open fun setEntries(entries: Array<CharSequence>)
Sets the human-readable entries to be shown in the list.
Link copied to clipboard
open fun setEntryValues(@ArrayRes entryValuesResId: Int)

open fun setEntryValues(entryValues: Array<CharSequence>)
The array to find the value to save for a preference when an entry from entries is selected.
Link copied to clipboard
open fun setSummary(@Nullable summary: CharSequence)
Sets the summary for this preference with a CharSequence.
Link copied to clipboard
open fun setValue(value: String)
Sets the value of the key.
Link copied to clipboard
open fun setValueIndex(index: Int)
Sets the value to the given index from the entry values.