# Loader.ForceLoadContentObserver

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# ForceLoadContentObserver

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/content/Loader.ForceLoadContentObserver "View this page in Java")  

```
class ForceLoadContentObserver<D : Any!> : ContentObserver
```

|---|---|----------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                        |||
| ↳ | [android.database.ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#)                             ||
|   | ↳ | [android.content.Loader.ForceLoadContentObserver](https://developer.android.com/reference/kotlin/android/content/Loader.ForceLoadContentObserver#) |

*** ** * ** ***

| **This class was deprecated in API level 28.**
|
| Use androidx.loader.content.Loader.ForceLoadContentObserver

An implementation of a ContentObserver that takes care of connecting it to the Loader to have the loader re-load its data when the observer is told it has changed. You do not normally need to use this yourself; it is used for you by [CursorLoader](https://developer.android.com/reference/kotlin/android/content/CursorLoader) to take care of executing an update when the cursor's backing data changes.

## Summary

|                                                                         Public constructors                                                                         ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [ForceLoadContentObserver](https://developer.android.com/reference/kotlin/android/content/Loader.ForceLoadContentObserver#ForceLoadContentObserver())`()` <br /> |

|                                                                                                                                                            Public methods                                                                                                                                                            ||
|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [deliverSelfNotifications](https://developer.android.com/reference/kotlin/android/content/Loader.ForceLoadContentObserver#deliverSelfNotifications())`()` <br />                                                                                 |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [onChange](https://developer.android.com/reference/kotlin/android/content/Loader.ForceLoadContentObserver#onChange(kotlin.Boolean))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> |

| Inherited functions ||
|---|---|
| From class [ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#) |------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [dispatchChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#dispatchChange(kotlin.Boolean))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Dispatches a change notification to the observer. If a [Handler](https://developer.android.com/reference/kotlin/android/os/Handler.html#) was supplied to the [ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#) constructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [dispatchChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#dispatchChange(kotlin.Boolean,%20android.net.Uri))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `uri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`)` Dispatches a change notification to the observer. Includes the changed content Uri when available. If a [Handler](https://developer.android.com/reference/kotlin/android/os/Handler.html#) was supplied to the [ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#) constructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. <br />                                                                                                                                                                                                                                                                                                                                                                                             | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [dispatchChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#dispatchChange(kotlin.Boolean,%20android.net.Uri,%20kotlin.Int))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `uri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Dispatches a change notification to the observer. Includes the changed content Uri when available. If a [Handler](https://developer.android.com/reference/kotlin/android/os/Handler.html#) was supplied to the [ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#) constructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. <br />                                                                                                                                                                                                                                                                                        | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [dispatchChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#dispatchChange(kotlin.Boolean,%20kotlin.collections.MutableCollection,%20kotlin.Int))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `uris:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!>`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Dispatches a change notification to the observer. Includes the changed content Uris when available. If a [Handler](https://developer.android.com/reference/kotlin/android/os/Handler.html#) was supplied to the [ContentObserver](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#) constructor, then a call to the #onChange method is posted to the handler's message queue. Otherwise, the #onChange method is invoked immediately on this thread. <br />                                                                                                                                            | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#onChange(kotlin.Boolean,%20android.net.Uri))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `uri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`)` 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: ```kotlin <code> // 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. } </code> ``` <br /> <br /> | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#onChange(kotlin.Boolean,%20android.net.Uri,%20kotlin.Int))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `uri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` 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. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onChange](https://developer.android.com/reference/kotlin/android/database/ContentObserver.html#onChange(kotlin.Boolean,%20kotlin.collections.MutableCollection,%20kotlin.Int))`(`selfChange:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `uris:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)!>`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` 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. <br />                                                                                                                                                                                                                                                                                                                        | ||

## Public constructors

### ForceLoadContentObserver

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
ForceLoadContentObserver()
```

## Public methods

### deliverSelfNotifications

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun deliverSelfNotifications(): Boolean
```

**Deprecated:** *Deprecated in Java.*

|                                                                           Return                                                                           ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | True if self-change notifications should be delivered to the observer. |

### onChange

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun onChange(selfChange: Boolean): Unit
```

**Deprecated:** *Deprecated in Java.*

|                                                                  Parameters                                                                   ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------|
| `selfChange` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): True if this is a self-change notification. |