public class ListPreference extends AbstractListPreference
| Modifier and Type | Class and Description |
|---|---|
static class |
ListPreference.SavedState
A data structure, which allows to save the internal state of a
ListPreference. |
| Constructor and Description |
|---|
ListPreference(android.content.Context context)
Creates a new preference, which allows to select a value from a list.
|
ListPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which allows to select a value from a list.
|
ListPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which allows to select a value from a list.
|
ListPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which allows to select a value from a list.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.CharSequence |
getEntry()
Returns the entry, the currently persisted value of the preference belongs to.
|
java.lang.CharSequence |
getSummary() |
java.lang.String |
getValue()
Returns the currently persisted value of the preference.
|
protected void |
onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
The method, which is invoked on subclasses when the preference's dialog has been closed.
|
protected java.lang.Object |
onGetDefaultValue(android.content.res.TypedArray typedArray,
int index) |
protected void |
onPrepareDialog(<any> dialogBuilder)
The method, which is invoked on subclasses when the preference's dialog is about to be
created.
|
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
protected void |
onSetInitialValue(java.lang.Object defaultValue) |
void |
setValue(java.lang.String value)
Sets the current value of the preference.
|
void |
setValueIndex(int index)
Sets the current value of the preference.
|
getDialogItemColor, getDialogItemTypeface, getEntries, getEntryValues, indexOf, setDialogItemColor, setDialogItemColor, setDialogItemTypeface, setEntries, setEntries, setEntryValues, setEntryValuesareDialogDividersShownOnScroll, createDialog, createDialogBuilder, getDialog, getDialogBackground, getDialogBottomMargin, getDialogButtonTextColor, getDialogButtonTypeface, getDialogCancelAnimation, getDialogDismissAnimation, getDialogDividerColor, getDialogDividerMargin, getDialogGravity, getDialogHeaderBackground, getDialogHeaderIcon, getDialogHeaderIconTintList, getDialogHeaderIconTintMode, getDialogHeight, getDialogIcon, getDialogIconTintList, getDialogIconTintMode, getDialogLeftMargin, getDialogMaxHeight, getDialogMaxWidth, getDialogMessage, getDialogMessageColor, getDialogMessageTypeface, getDialogPaddingBottom, getDialogPaddingLeft, getDialogPaddingRight, getDialogPaddingTop, getDialogRightMargin, getDialogScrollableArea, getDialogShowAnimation, getDialogTitle, getDialogTitleColor, getDialogTitleTypeface, getDialogTopMargin, getDialogWidth, getDialogWindowBackground, getNegativeButtonText, getPositiveButtonText, isDialogButtonBarDividerShown, isDialogFitsSystemWindowsBottom, isDialogFitsSystemWindowsLeft, isDialogFitsSystemWindowsRight, isDialogFitsSystemWindowsTop, isDialogFullscreen, isDialogHeaderShown, isDialogShown, isValueShownAsSummary, needInputMethod, onCancel, onClick, onClick, onDismiss, onKey, onShow, performClick, setCustomDialogButtonBar, setCustomDialogButtonBar, setCustomDialogHeader, setCustomDialogHeader, setCustomDialogMessage, setCustomDialogMessage, setCustomDialogTitle, setCustomDialogTitle, setDialogBackground, setDialogBackground, setDialogBackgroundColor, setDialogButtonTextColor, setDialogButtonTextColor, setDialogButtonTypeface, setDialogCancelAnimation, setDialogDismissAnimation, setDialogDividerColor, setDialogDividerMargin, setDialogFitsSystemWindows, setDialogFitsSystemWindows, setDialogFullscreen, setDialogGravity, setDialogHeaderBackground, setDialogHeaderBackground, setDialogHeaderBackgroundColor, setDialogHeaderIcon, setDialogHeaderIcon, setDialogHeaderIconTint, setDialogHeaderIconTintList, setDialogHeaderIconTintMode, setDialogHeight, setDialogIcon, setDialogIcon, setDialogIconTint, setDialogIconTintList, setDialogIconTintMode, setDialogMargin, setDialogMaxHeight, setDialogMaxWidth, setDialogMessage, setDialogMessage, setDialogMessageColor, setDialogMessageTypeface, setDialogPadding, setDialogScrollableArea, setDialogScrollableArea, setDialogShowAnimation, setDialogTitle, setDialogTitle, setDialogTitleColor, setDialogTitleTypeface, setDialogWidth, setDialogWindowBackground, setDialogWindowBackground, setNegativeButtonText, setNegativeButtonText, setOnCancelListener, setOnClickListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setPositiveButtonText, setPositiveButtonText, showDialogButtonBarDivider, showDialogDividersOnScroll, showDialogHeader, showValueAsSummarygetIconTintList, getIconTintMode, setIcon, setIconTint, setIconTintList, setIconTintModepublic ListPreference(android.content.Context context)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullpublic ListPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availablepublic ListPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcepublic ListPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcedefaultStyleResource - A resource identifier of a style resource that supplies default values for the
preference, used only if the default style is 0 or can not be found in the theme. Can
be 0 to not look for defaultspublic final java.lang.String getValue()
Stringpublic final void setValue(java.lang.String value)
value - The value, which should be set, as a Stringpublic final void setValueIndex(int index)
index - The index of the value, which should be set, as an Integer valuepublic final java.lang.CharSequence getEntry()
CharSequencepublic final java.lang.CharSequence getSummary()
protected final java.lang.Object onGetDefaultValue(android.content.res.TypedArray typedArray,
int index)
protected final void onSetInitialValue(java.lang.Object defaultValue)
protected void onPrepareDialog(<any> dialogBuilder)
DialogPreferenceonPrepareDialog in class AbstractListPreferencedialogBuilder - The builder, which is used to create the preference's dialog, as an instance of the
class AbstractMaterialDialogBuilderprotected void onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
DialogPreferenceonDialogClosed in class DialogPreferencedialog - The dialog, which has been closed, as an instance of the class
AbstractButtonBarDialog. The dialog may not be nullpositiveResult - True, if the dialog has been close affirmatively, false otherwiseprotected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class DialogPreferenceprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class DialogPreference