共用方式為


Preferences.AddPreferenceChangeListener(IPreferenceChangeListener) Method

Definition

Registers the specified listener to receive preference change events for this preference node.

[Android.Runtime.Register("addPreferenceChangeListener", "(Ljava/util/prefs/PreferenceChangeListener;)V", "GetAddPreferenceChangeListener_Ljava_util_prefs_PreferenceChangeListener_Handler")]
public abstract void AddPreferenceChangeListener (Java.Util.Prefs.IPreferenceChangeListener? pcl);
[<Android.Runtime.Register("addPreferenceChangeListener", "(Ljava/util/prefs/PreferenceChangeListener;)V", "GetAddPreferenceChangeListener_Ljava_util_prefs_PreferenceChangeListener_Handler")>]
abstract member AddPreferenceChangeListener : Java.Util.Prefs.IPreferenceChangeListener -> unit

Parameters

pcl
IPreferenceChangeListener

The preference change listener to add.

Attributes

Exceptions

if the given listener is null.

if this node has been removed.

Remarks

Registers the specified listener to receive preference change events for this preference node. A preference change event is generated when a preference is added to this node, removed from this node, or when the value associated with a preference is changed. (Preference change events are not generated by the #removeNode() method, which generates a node change event. Preference change events are generated by the clear method.)

Events are only guaranteed for changes made within the same JVM as the registered listener, though some implementations may generate events for changes made outside this JVM. Events may be generated before the changes have been made persistent. Events are not generated when preferences are modified in descendants of this node; a caller desiring such events must register with each descendant.

Java documentation for java.util.prefs.Preferences.addPreferenceChangeListener(java.util.prefs.PreferenceChangeListener).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to