Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
Added in API level 1
public static interface

Preference.OnPreferenceChangeListener

android.preference.Preference.OnPreferenceChangeListener

Class Overview

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

public abstract boolean onPreferenceChange ( Preference preference, Object newValue)

Added in API level 1

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 The changed Preference.
newValue The new value of the Preference.
Returns
  • True to update the state of the Preference with the new value.