Android.Database.ContentObserver.OnChange Method
This method is called when a content change occurs.

Syntax

[Android.Runtime.Register("onChange", "(ZLandroid/net/Uri;)V", "GetOnChange_ZLandroid_net_Uri_Handler")]
public virtual void OnChange (bool selfChange, Android.Net.Uri uri)

Parameters

selfChange
True if this is a self-change notification.
uri
The Uri of the changed content, or null if unknown.

Remarks

This method is called when a content change occurs. Includes the changed content Uri when available.

Subclasses should override this method to handle content changes. To ensure correct operation on older versions of the framework that did not provide a Uri argument, applications should also implement the ContentObserver.OnChange(bool) overload of this method whenever they implement the ContentObserver.OnChange(bool, Android.Net.Uri) overload.

Example implementation:

java Example

 // Implement the onChange(boolean) method to delegate the change notification to
 // the onChange(boolean, Uri) method to ensure correct operation on older versions
 // of the framework that did not have the onChange(boolean, Uri) method.
 @Override
 public void onChange(boolean selfChange) {
     onChange(selfChange, null);
 }

 // Implement the onChange(boolean, Uri) method to take advantage of the new Uri argument.
 @Override
 public void onChange(boolean selfChange, Uri uri) {
     // Handle change.
 }
 

[Android Documentation]

Requirements

Namespace: Android.Database
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16