to top
Android APIs
Added in API level 1
public static interface

SharedPreferences.OnSharedPreferenceChangeListener

android.content.SharedPreferences.OnSharedPreferenceChangeListener

Class Overview

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

Summary

Public Methods

? Examples
abstract void onSharedPreferenceChanged( SharedPreferences sharedPreferences, String key)
Called when a shared preference is changed, added, or removed.

Public Methods

public abstract void onSharedPreferenceChanged (SharedPreferences sharedPreferences, String key)

Added in API level 1

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.

Parameters
sharedPreferences The SharedPreferences that received the change.
key The key of the preference that was changed, added, or removed.
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.