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

MultiSelectListPreference

public class MultiSelectListPreference
extends DialogPreference

java.lang.Object
   ↳ android.support.v7.preference.Preference
     ↳ android.support.v7.preference.DialogPreference
       ↳ android.support.v14.preference.MultiSelectListPreference


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

This preference will store a set of strings into the SharedPreferences. This set will contain one or more mValues 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

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

void setValues(Set<String> values)

Sets the value of 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(boolean restoreValue, Object defaultValue)

Implement this to set the initial value of the Preference.

Inherited methods

From class android.support.v7.preference.DialogPreference
From class android.support.v7.preference.Preference