Stay organized with collections
Save and categorize content based on your preferences.
ObserverCallback
interface ObserverCallback
An interface which apps can implement to subscribe to notifications of changes to AppSearch data.
Summary
Public methods |
abstract Unit |
Callback to trigger after document changes (documents added, updated or removed).
|
abstract Unit |
Callback to trigger after schema changes (schema type added, updated or removed).
|
Public methods
onDocumentChanged
abstract fun onDocumentChanged(changeInfo: DocumentChangeInfo): Unit
Callback to trigger after document changes (documents added, updated or removed).
Parameters |
changeInfo |
DocumentChangeInfo: Information about the nature of the change. This value cannot be null . |
onSchemaChanged
abstract fun onSchemaChanged(changeInfo: SchemaChangeInfo): Unit
Callback to trigger after schema changes (schema type added, updated or removed).
Parameters |
changeInfo |
SchemaChangeInfo: Information about the nature of the change. This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ObserverCallback\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions)\n\nObserverCallback\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/appsearch/observer/ObserverCallback \"View this page in Java\") \n\n```\ninterface ObserverCallback\n```\n\n|------------------------------------------------------|\n| [android.app.appsearch.observer.ObserverCallback](#) |\n\nAn interface which apps can implement to subscribe to notifications of changes to AppSearch data.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDocumentChanged](#onDocumentChanged(android.app.appsearch.observer.DocumentChangeInfo))`(`changeInfo:` `[DocumentChangeInfo](/reference/kotlin/android/app/appsearch/observer/DocumentChangeInfo)`)` Callback to trigger after document changes (documents added, updated or removed). |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSchemaChanged](#onSchemaChanged(android.app.appsearch.observer.SchemaChangeInfo))`(`changeInfo:` `[SchemaChangeInfo](/reference/kotlin/android/app/appsearch/observer/SchemaChangeInfo)`)` Callback to trigger after schema changes (schema type added, updated or removed). |\n\nPublic methods\n--------------\n\n### onDocumentChanged\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nabstract fun onDocumentChanged(changeInfo: DocumentChangeInfo): Unit\n```\n\nCallback to trigger after document changes (documents added, updated or removed).\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `changeInfo` | [DocumentChangeInfo](/reference/kotlin/android/app/appsearch/observer/DocumentChangeInfo): Information about the nature of the change. This value cannot be `null`. |\n\n### onSchemaChanged\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [T Extensions 3](https://developer.android.com/sdkExtensions) \n\n```\nabstract fun onSchemaChanged(changeInfo: SchemaChangeInfo): Unit\n```\n\nCallback to trigger after schema changes (schema type added, updated or removed).\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `changeInfo` | [SchemaChangeInfo](/reference/kotlin/android/app/appsearch/observer/SchemaChangeInfo): Information about the nature of the change. This value cannot be `null`. |"]]