# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# ContentObserver

`public abstract class ContentObserver`
`extends Object` ``

java.lang.Object
↳ | android.database.ContentObserver

Known direct subclasses AbstractCursor.SelfContentObserver, Loader.ForceLoadContentObserver
AbstractCursor.SelfContentObserver | Cursors use this class to track changes others make to their URI.
Loader.ForceLoadContentObserver | This class is deprecated. Use `Loader.ForceLoadContentObserver`

Receives call backs for changes to content. Must be implemented by objects which are added to a `ContentObservable`.

## Summary

### Public constructors
`ContentObserver(Handler handler)` Creates a content observer.

### Public methods
`boolean` | `deliverSelfNotifications()` Returns true if this observer is interested receiving self-change notifications.
`final void` | `dispatchChange(boolean selfChange)` This method is deprecated. Callers should migrate towards using a richer overload that provides more details about the change, such as `dispatchChange(boolean, java.util.Collection, int)`.
`final void` | `dispatchChange(boolean selfChange, Uri uri)` Dispatches a change notification to the observer.
`final void` | `dispatchChange(boolean selfChange, Uri uri, int flags)` Dispatches a change notification to the observer.
`final void` | `dispatchChange(boolean selfChange, Collection<Uri> uris, int flags)` Dispatches a change notification to the observer.
`void` | `onChange(boolean selfChange, Uri uri, int flags)` This method is called when a content change occurs.
`void` | `onChange(boolean selfChange)` This method is called when a content change occurs.
`void` | `onChange(boolean selfChange, Uri uri)` This method is called when a content change occurs.
`void` | `onChange(boolean selfChange, Collection<Uri> uris, int flags)` This method is called when a content change occurs.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### ContentObserver

    public ContentObserver (Handler handler)

Creates a content observer.

Parameters
`handler` | `Handler`: The handler to run `onChange(boolean)` on, or null if none.

## Public methods

### deliverSelfNotifications

    public boolean deliverSelfNotifications ()

Returns true if this observer is interested receiving self-change notifications. Subclasses should override this method to indicate whether the observer is interested in receiving notifications for changes that it made to the content itself.

Returns
`boolean` | True if self-change notifications should be delivered to the observer.

### dispatchChange

    public final void dispatchChange (boolean selfChange)

This method is deprecated.
Callers should migrate towards using a richer overload that provides more details about the change, such as `dispatchChange(boolean, java.util.Collection, int)`.

Dispatches a change notification to the observer.

If a `Handler` was supplied to the `ContentObserver` constructor, then a call to the `onChange(boolean)` method is posted to the handler's message queue. Otherwise, the `onChange(boolean)` method is invoked immediately on this thread.

Parameters
`selfChange` | `boolean`

### dispatchChange

    public final void dispatchChange (boolean selfChange,
                    Uri uri)

Dispatches a change notification to the observer. Includes the changed content Uri when available.

If a `Handler` was supplied to the `ContentObserver` constructor, then a call to the `onChange(boolean)` method is posted to the handler's message queue. Otherwise, the `onChange(boolean)` method is invoked immediately on this thread.

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.
`uri` | `Uri`: The Uri of the changed content. This value may be `null`.

### dispatchChange

    public final void dispatchChange (boolean selfChange,
                    Uri uri,
                    int flags)

Dispatches a change notification to the observer. Includes the changed content Uri when available.

If a `Handler` was supplied to the `ContentObserver` constructor, then a call to the `onChange(boolean)` method is posted to the handler's message queue. Otherwise, the `onChange(boolean)` method is invoked immediately on this thread.

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.
`uri` | `Uri`: The Uri of the changed content. This value may be `null`.
`flags` | `int`: Flags indicating details about this change. Value is either `0` or a combination of `ContentResolver.NOTIFY_SYNC_TO_NETWORK`, `ContentResolver.NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS`, `ContentResolver.NOTIFY_INSERT`, `ContentResolver.NOTIFY_UPDATE`, and `ContentResolver.NOTIFY_DELETE`

### dispatchChange

    public final void dispatchChange (boolean selfChange,
                    Collection<Uri> uris,
                    int flags)

Dispatches a change notification to the observer. Includes the changed content Uris when available.

If a `Handler` was supplied to the `ContentObserver` constructor, then a call to the `onChange(boolean)` method is posted to the handler's message queue. Otherwise, the `onChange(boolean)` method is invoked immediately on this thread.

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.
`uris` | `Collection`: The Uri of the changed content. This value cannot be `null`.
`flags` | `int`: Flags indicating details about this change. Value is either `0` or a combination of `ContentResolver.NOTIFY_SYNC_TO_NETWORK`, `ContentResolver.NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS`, `ContentResolver.NOTIFY_INSERT`, `ContentResolver.NOTIFY_UPDATE`, and `ContentResolver.NOTIFY_DELETE`

### onChange

    public void onChange (boolean selfChange,
                    Uri uri,
                    int flags)

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 richer arguments, applications should implement all overloads.

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.
`uri` | `Uri`: The Uri of the changed content. This value may be `null`.
`flags` | `int`: Flags indicating details about this change. Value is either `0` or a combination of `ContentResolver.NOTIFY_SYNC_TO_NETWORK`, `ContentResolver.NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS`, `ContentResolver.NOTIFY_INSERT`, `ContentResolver.NOTIFY_UPDATE`, and `ContentResolver.NOTIFY_DELETE`

### onChange

    public void onChange (boolean selfChange)

This method is called when a content change occurs.

Subclasses should override this method to handle content changes.

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.

### onChange

    public void onChange (boolean selfChange,
                    Uri uri)

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 richer arguments, applications should implement all overloads.

Example implementation:

     // 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.
     }

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.
`uri` | `Uri`: The Uri of the changed content. This value may be `null`.

### onChange

    public void onChange (boolean selfChange,
                    Collection<Uri> uris,
                    int flags)

This method is called when a content change occurs. Includes the changed content Uris 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 richer arguments, applications should implement all overloads.

Parameters
`selfChange` | `boolean`: True if this is a self-change notification.
`uris` | `Collection`: The Uris of the changed content. This value cannot be `null`.
`flags` | `int`: Flags indicating details about this change. Value is either `0` or a combination of `ContentResolver.NOTIFY_SYNC_TO_NETWORK`, `ContentResolver.NOTIFY_SKIP_NOTIFY_FOR_DESCENDANTS`, `ContentResolver.NOTIFY_INSERT`, `ContentResolver.NOTIFY_UPDATE`, and `ContentResolver.NOTIFY_DELETE`

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