Java android.preference Preference fields, constructors, methods, implement or subclass

Example usage for Java android.preference Preference fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.preference Preference.

The text is from its open source code.

Subclass

android.preference.Preference has subclasses.
Click this link to see all its subclasses.

Constructor

Preference(Context context)
Constructor to create a Preference.
Preference(Context context, AttributeSet attrs)
Constructor that is called when inflating a Preference from XML.

Method

booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
ClassgetClass()
Returns the runtime class of this Object .
ContextgetContext()
Returns the android.content.Context of this Preference.
SharedPreferences.EditorgetEditor()
Returns an SharedPreferences.Editor where this Preference can save its value(s).
BundlegetExtras()
Return the extras Bundle object associated with this preference, creating a new Bundle if there currently isn't one.
StringgetFragment()
Return the fragment class name associated with this Preference.
DrawablegetIcon()
Returns the icon of this Preference.
IntentgetIntent()
Return the Intent associated with this Preference.
StringgetKey()
Gets the key for this Preference, which is also the key used for storing values into SharedPreferences or PreferenceDataStore .
OnPreferenceChangeListenergetOnPreferenceChangeListener()
Returns the callback to be invoked when this Preference is changed by the user (but before the internal state has been updated).
OnPreferenceClickListenergetOnPreferenceClickListener()
Returns the callback to be invoked when this Preference is clicked.
intgetOrder()
Gets the order of this Preference with respect to other Preference objects on the same level.
SharedPreferencesgetSharedPreferences()
Returns the SharedPreferences where this Preference can read its value(s).
CharSequencegetSummary()
Returns the summary of this Preference.
CharSequencegetTitle()
Returns the title of this Preference.
intgetTitleRes()
Returns the title resource ID of this Preference.
booleanhasKey()
Checks whether this Preference has a valid key.
booleanisEnabled()
Checks whether this Preference should be enabled in the list.
booleanisPersistent()
Checks whether this Preference is persistent.
voidsetDefaultValue(Object defaultValue)
Sets the default value for this Preference, which will be set either if persistence is off or persistence is on and the preference is not found in the persistent storage.
voidsetEnabled(boolean enabled)
Sets whether this Preference is enabled.
voidsetFragment(String fragment)
Sets the class name of a fragment to be shown when this Preference is clicked.
voidsetIcon(Drawable icon)
Sets the icon for this Preference with a Drawable.
voidsetIcon(@DrawableRes int iconResId)
Sets the icon for this Preference with a resource ID.
voidsetIntent(Intent intent)
Sets an Intent to be used for Context#startActivity(Intent) when this Preference is clicked.
voidsetKey(String key)
Sets the key for this Preference, which is used as a key to the SharedPreferences or PreferenceDataStore .
voidsetLayoutResource(@LayoutRes int layoutResId)
Sets the layout resource that is inflated as the View to be shown for this Preference.
voidsetOnPreferenceChangeListener(OnPreferenceChangeListener onPreferenceChangeListener)
Sets the callback to be invoked when this Preference is changed by the user (but before the internal state has been updated).
voidsetOnPreferenceClickListener(OnPreferenceClickListener onPreferenceClickListener)
Sets the callback to be invoked when this Preference is clicked.
voidsetOrder(int order)
Sets the order of this Preference with respect to other Preference objects on the same level.
voidsetPersistent(boolean persistent)
Sets whether this Preference is persistent.
voidsetSelectable(boolean selectable)
Sets whether this Preference is selectable.
voidsetSummary(CharSequence summary)
Sets the summary for this Preference with a CharSequence.
voidsetSummary(@StringRes int summaryResId)
Sets the summary for this Preference with a resource ID.
voidsetTitle(CharSequence title)
Sets the title for this Preference with a CharSequence.
voidsetTitle(@StringRes int titleResId)
Sets the title for this Preference with a resource ID.
StringtoString()