Skip to content

Most visited

Recently visited

navigation
Added in API level 1

PreferenceChangeEvent

public class PreferenceChangeEvent
extends EventObject implements Serializable

java.lang.Object
   ↳ java.util.EventObject
     ↳ java.util.prefs.PreferenceChangeEvent


This is the event class to indicate that a preference has been added, deleted or updated.

Please note that although the class is marked as Serializable by inheritance from EventObject, this type is not intended to be serialized so the serialization methods do nothing but throw a NotSerializableException.

See also:

Summary

Inherited fields

From class java.util.EventObject

Public constructors

PreferenceChangeEvent(Preferences p, String k, String v)

Construct a new PreferenceChangeEvent instance.

Public methods

String getKey()

Gets the key of the changed preference.

String getNewValue()

Gets the new value of the changed preference or null if the preference has been removed.

Preferences getNode()

Gets the Preferences instance that fired this event.

Inherited methods

From class java.util.EventObject
From class java.lang.Object

Public constructors

PreferenceChangeEvent

Added in API level 1
PreferenceChangeEvent (Preferences p, 
                String k, 
                String v)

Construct a new PreferenceChangeEvent instance.

Parameters
p Preferences: the Preferences instance that fired this event; this object is considered as the event's source.
k String: the changed preference key.
v String: the new value of the changed preference, this value can be null, which means the preference has been removed.

Public methods

getKey

Added in API level 1
String getKey ()

Gets the key of the changed preference.

Returns
String the changed preference's key.

getNewValue

Added in API level 1
String getNewValue ()

Gets the new value of the changed preference or null if the preference has been removed.

Returns
String the new value of the changed preference or null if the preference has been removed.

getNode

Added in API level 1
Preferences getNode ()

Gets the Preferences instance that fired this event.

Returns
Preferences the Preferences instance that fired this event.
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.