ContentObservablepublic class ContentObservable extends Observable A specialization of {@link Observable} for {@link ContentObserver}
that provides methods for sending notifications to a list of
{@link ContentObserver} objects. |
Methods Summary |
---|
public void | dispatchChange(boolean selfChange)Invokes {@link ContentObserver#dispatchChange(boolean)} on each observer.
If selfChange is true, only delivers the notification
to the observer if it has indicated that it wants to receive self-change
notifications by implementing {@link ContentObserver#deliverSelfNotifications}
to return true.
dispatchChange(selfChange, null);
| public void | dispatchChange(boolean selfChange, android.net.Uri uri)Invokes {@link ContentObserver#dispatchChange(boolean, Uri)} on each observer.
Includes the changed content Uri when available.
If selfChange is true, only delivers the notification
to the observer if it has indicated that it wants to receive self-change
notifications by implementing {@link ContentObserver#deliverSelfNotifications}
to return true.
synchronized(mObservers) {
for (ContentObserver observer : mObservers) {
if (!selfChange || observer.deliverSelfNotifications()) {
observer.dispatchChange(selfChange, uri);
}
}
}
| public void | notifyChange(boolean selfChange)Invokes {@link ContentObserver#onChange} on each observer.
synchronized(mObservers) {
for (ContentObserver observer : mObservers) {
observer.onChange(selfChange, null);
}
}
| public void | registerObserver(ContentObserver observer)
super.registerObserver(observer);
|
|