added in version 24.1.0
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1

ListPreference

public class ListPreference
extends DialogPreference

java.lang.Object
   ↳ android.support.v7.preference.Preference
     ↳ android.support.v7.preference.DialogPreference
       ↳ android.support.v7.preference.ListPreference
Known Direct Subclasses


A Preference that displays a list of entries as a dialog.

This preference will store a string into the SharedPreferences. This string will be the value from the setEntryValues(CharSequence[]) array.

Summary

Inherited XML attributes

From class android.support.v7.preference.Preference

Inherited constants

From class android.support.v7.preference.Preference

Public constructors

ListPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
ListPreference(Context context, AttributeSet attrs, int defStyleAttr)
ListPreference(Context context, AttributeSet attrs)
ListPreference(Context context)

Public methods

int findIndexOfValue(String value)

Returns the index of the given value (in the entry values array).

CharSequence[] getEntries()

The list of entries to be shown in the list in subsequent dialogs.

CharSequence getEntry()

Returns the entry corresponding to the current value.

CharSequence[] getEntryValues()

Returns the array of values to be saved for the preference.

CharSequence getSummary()

Returns the summary of this ListPreference.

String getValue()

Returns the value of the key.

void setEntries(CharSequence[] entries)

Sets the human-readable entries to be shown in the list.

void setEntries(int entriesResId)
void setEntryValues(int entryValuesResId)
void setEntryValues(CharSequence[] entryValues)

The array to