MultiSelectListPreference

public class MultiSelectListPreference
extends DialogPreference

java.lang.Object
   ↳ androidx.preference.Preference
     ↳ androidx.preference.DialogPreference
       ↳ androidx.preference.MultiSelectListPreference


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

This preference saves a set of strings. This set will contain one or more mValues from the setEntryValues(CharSequence[]) array.

Summary

Inherited constants

Public constructors

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

Public methods

int findIndexOfValue(String value)

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

CharSequence[] getEntries()

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

CharSequence[] getEntryValues()

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

Set<String> getValues()

Retrieves the current values 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 find the value to save for a preference when an entry from entries is selected.

void setValues(Set<String> values)

Sets the values for the key.

Protected methods

boolean[] getSelectedItems()
Object onGetDefaultValue(TypedArray a, int index)

Called when a preference is being inflated and the default value attribute needs to be read.

void onRestoreInstanceState(Parcelable state)

Hook allowing a preference to re-apply a representation of its internal state that had previously been generated by onSaveInstanceState().

Parcelable onSaveInstanceState()

Hook allowing a preference to generate a representation of its internal state that can later be used to create a new instance with that same state.

void onSetInitialValue(Object defaultValue)

Implement this to set the initial value of the preference.

Inherited methods