IT. Expert System.

Android Reference

ListPreference


android.preference

Class ListPreference

    • Constructor Detail

      • ListPreference

        public ListPreference(Context context)
    • Method Detail

      • setEntries

        public void setEntries(int entriesResId)
        Parameters:
        entriesResId - The entries array as a resource.
        See Also:
        setEntries(CharSequence[])
      • getEntries

        public CharSequence[] getEntries()
        The list of entries to be shown in the list in subsequent dialogs.
        Returns:
        The list as an array.
      • setEntryValues

        public void setEntryValues(CharSequence[] entryValues)
        The array to find the value to save for a preference when an entry from entries is selected. If a user clicks on the second item in entries, the second item in this array will be saved to the preference.
        Parameters:
        entryValues - The array to be used as values to save for the preference.
      • setEntryValues

        public void setEntryValues(int entryValuesResId)
        Parameters:
        entryValuesResId - The entry values array as a resource.
        See Also:
        setEntryValues(CharSequence[])
      • getEntryValues

        public CharSequence[] getEntryValues()
        Returns the array of values to be saved for the preference.
        Returns:
        The array of values.
      • setValue

        public void setValue(String value)
        Sets the value of the key. This should be one of the entries in getEntryValues().
        Parameters:
        value - The value to set for the key.
      • setSummary

        public void setSummary(CharSequence summary)
        Sets the summary for this Preference with a CharSequence. If the summary has a String formatting marker in it (i.e. "%s" or "%1$s"), then the current entry value will be substituted in its place when it's retrieved.
        Overrides:
        setSummary in class Preference
        Parameters:
        summary - The summary for the preference.
      • setValueIndex

        public void setValueIndex(int index)
        Sets the value to the given index from the entry values.
        Parameters:
        index - The index of the value to set.
      • getValue

        public String getValue()
        Returns the value of the key. This should be one of the entries in getEntryValues().
        Returns:
        The value of the key.
      • getEntry

        public CharSequence getEntry()
        Returns the entry corresponding to the current value.
        Returns:
        The entry corresponding to the current value, or null.
      • findIndexOfValue

        public int findIndexOfValue(String value)
        Returns the index of the given value (in the entry values array).
        Parameters:
        value - The value whose index should be returned.
        Returns:
        The index of the value, or -1 if not found.
      • onPrepareDialogBuilder

        protected void onPrepareDialogBuilder(AlertDialog.Builder builder)
        Description copied from class: DialogPreference
        Prepares the dialog builder to be shown when the preference is clicked. Use this to set custom properties on the dialog.

        Do not AlertDialog.Builder#create() or AlertDialog.Builder#show().

        Overrides:
        onPrepareDialogBuilder in class DialogPreference
      • onDialogClosed

        protected void onDialogClosed(boolean positiveResult)
        Description copied from class: DialogPreference
        Called when the dialog is dismissed and should be used to save data to the SharedPreferences.
        Overrides:
        onDialogClosed in class DialogPreference
        Parameters:
        positiveResult - Whether the positive button was clicked (true), or the negative button was clicked or the dialog was canceled (false).
      • onGetDefaultValue

        protected Object onGetDefaultValue(TypedArray a,
                               int index)
        Description copied from class: Preference
        Called when a Preference is being inflated and the default value attribute needs to be read. Since different Preference types have different value types, the subclass should get and return the default value which will be its value type.

        For example, if the value type is String, the body of the method would proxy to TypedArray.getString(int).

        Overrides:
        onGetDefaultValue in class Preference
        Parameters:
        a - The set of attributes.
        index - The index of the default value attribute.
        Returns:
        The default value of this preference type.
      • onSetInitialValue

        protected void onSetInitialValue(boolean restoreValue,
                             Object defaultValue)
        Description copied from class: Preference
        Implement this to set the initial value of the Preference.

        If restorePersistedValue is true, you should restore the Preference value from the SharedPreferences. If restorePersistedValue is false, you should set the Preference value to defaultValue that is given (and possibly store to SharedPreferences if Preference.shouldPersist() is true).

        This may not always be called. One example is if it should not persist but there is no default value given.

        Overrides:
        onSetInitialValue in class Preference
        Parameters:
        restoreValue - True to restore the persisted value; false to use the given defaultValue.
        defaultValue - The default value for this Preference. Only use this if restorePersistedValue is false.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 138 / . Delta: 0.04406 с