# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

# SharedPreferences.OnSharedPreferenceChangeListener

`public static interface SharedPreferences.OnSharedPreferenceChangeListener`
``

android.content.SharedPreferences.OnSharedPreferenceChangeListener

Interface definition for a callback to be invoked when a shared preference is changed.

## Summary

### Public methods
`abstract void` | `onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)` Called when a shared preference is changed, added, or removed.

## Public methods

### onSharedPreferenceChanged

    public abstract void onSharedPreferenceChanged (SharedPreferences sharedPreferences,
                    String key)

Called when a shared preference is changed, added, or removed. This may be called even if a preference is set to its existing value.

This callback will be run on your main thread.

Note: This callback will not be triggered when preferences are cleared via `Editor#clear()`, unless targeting `Build.VERSION_CODES.R` on devices running OS versions `Android R` or later.

Parameters
`sharedPreferences` | `SharedPreferences`: The `SharedPreferences` that received the change.
`key` | `String`: The key of the preference that was changed, added, or removed. Apps targeting `Build.VERSION_CODES.R` on devices running OS versions `Android R` or later, will receive a `null` value when preferences are cleared.

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