Added in API level 1

ContentObservable


open class ContentObservable : Observable<ContentObserver!>
kotlin.Any
   ↳ android.database.Observable<android.database.ContentObserver>
   ↳ android.database.ContentObservable

A specialization of Observable for ContentObserver that provides methods for sending notifications to a list of ContentObserver objects.

Summary

Public constructors

Public methods
open Unit
dispatchChange(selfChange: Boolean)

Invokes ContentObserver#dispatchChange(boolean) on each observer.

open Unit
dispatchChange(selfChange: Boolean, uri: Uri!)

Invokes ContentObserver#dispatchChange(boolean, Uri) on each observer.

open Unit
notifyChange(selfChange: Boolean)

Invokes android.

open Unit

Inherited functions
Inherited properties

Public constructors

ContentObservable

ContentObservable()

Public methods

dispatchChange

Added in API level 1
Deprecated in API level 16
open fun dispatchChange(selfChange: Boolean): Unit

Deprecated: Use dispatchChange(boolean,android.net.Uri) instead.

Invokes 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 ContentObserver#deliverSelfNotifications to return true.

Parameters
selfChange Boolean: True if this is a self-change notification.

dispatchChange

Added in API level 16
open fun dispatchChange(
    selfChange: Boolean,
    uri: Uri!
): Unit

Invokes 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 ContentObserver#deliverSelfNotifications to return true.

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

notifyChange

Added in API level 1
Deprecated in API level 16
open fun notifyChange(selfChange: Boolean): Unit

Deprecated: Use #dispatchChange instead.

Invokes android.database.ContentObserver#onChange on each observer.

Parameters
selfChange Boolean: True if this is a self-change notification.

registerObserver

Added in API level 1
open fun registerObserver(observer: ContentObserver!): Unit
Parameters
observer ContentObserver!: the observer to register
Exceptions
java.lang.IllegalArgumentException the observer is null
java.lang.IllegalStateException the observer is already registered