EditTextPreference

public class EditTextPreference
extends DialogPreference

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


A DialogPreference that shows a EditText in the dialog.

This preference saves a string value.

Summary

Nested classes

interface EditTextPreference.OnBindEditTextListener

Interface definition for a callback to be invoked when the corresponding dialog view for this preference is bound. 

class EditTextPreference.SimpleSummaryProvider

A simple Preference.SummaryProvider implementation for an EditTextPreference

Inherited constants

Public constructors

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

Public methods

String getText()

Gets the text from the current data storage.

void setOnBindEditTextListener(EditTextPreference.OnBindEditTextListener onBindEditTextListener)

Set an EditTextPreference.OnBindEditTextListener that will be invoked when the corresponding dialog view for this preference is bound.

void setText(String text)

Saves the text to the current data storage.

boolean shouldDisableDependents()

Checks whether this preference's dependents should currently be disabled.

Protected methods

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