# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

# Preference.OnPreferenceChangeListener

`public static interface Preference.OnPreferenceChangeListener`
``

android.preference.Preference.OnPreferenceChangeListener

This interface is deprecated.
Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings.

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

    public abstract 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.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*