Skip to content

Most visited

Recently visited

navigation
Added in API level 1

Preference.OnPreferenceChangeListener

public static interface Preference.OnPreferenceChangeListener

android.preference.Preference.OnPreferenceChangeListener


Interface definition for a callback to be invoked when the value of this Preference has been changed by the user and is about to be set and/or persisted. This gives the client a chance to prevent setting and/or persisting the value.

Summary

Public methods

abstract boolean onPreferenceChange(Preference preference, Object newValue)

Called when a Preference has been changed by the user.

Public methods

onPreferenceChange

Added in API level 1
boolean onPreferenceChange (Preference preference, 
                Object newValue)

Called when a Preference has been changed by the user. This is called before the state of the Preference is about to be updated and before the state is persisted.

Parameters
preference Preference: The changed Preference.
newValue Object: The new value of the Preference.
Returns
boolean True to update the state of the Preference with the new value.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.