Stay organized with collections
Save and categorize content based on your preferences.
BatchResultCallback
interface BatchResultCallback<KeyType : Any!, ValueType : Any!>
The callback interface to return AppSearchBatchResult
.
Summary
Public methods
onSystemError
open fun onSystemError(throwable: Throwable?): Unit
Called when a system error occurs.
This method is only called the infrastructure is fundamentally broken or unavailable, such that none of the requests could be started. For example, it will be called if the AppSearch service unexpectedly fails to initialize and can't be recovered by any means, or if communicating to the server over Binder fails (for example system service crashed or device is rebooting).
The error is not expected to be recoverable and there is no specific recommended action other than displaying a permanent message to the user.
Normal errors that are caused by invalid inputs or recoverable/retriable situations are reported associated with the input that caused them via the onResult
method.
Parameters |
throwable |
Throwable?: an exception describing the system error This value may 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,["# BatchResultCallback\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBatchResultCallback\n===================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/appsearch/BatchResultCallback \"View this page in Java\") \n\n```\ninterface BatchResultCallback\u003cKeyType : Any!, ValueType : Any!\u003e\n```\n\n|------------------------------------------------|\n| [android.app.appsearch.BatchResultCallback](#) |\n\nThe callback interface to return [AppSearchBatchResult](/reference/kotlin/android/app/appsearch/AppSearchBatchResult).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResult](#onResult(android.app.appsearch.AppSearchBatchResult))`(`result:` `[AppSearchBatchResult](/reference/kotlin/android/app/appsearch/AppSearchBatchResult)\u003cKeyType,` `ValueType\u003e`)` Called when [AppSearchBatchResult](/reference/kotlin/android/app/appsearch/AppSearchBatchResult) results are ready. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSystemError](#onSystemError(kotlin.Throwable))`(`throwable:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` Called when a system error occurs. |\n\nPublic methods\n--------------\n\n### onResult\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onResult(result: AppSearchBatchResult\u003cKeyType, ValueType\u003e): Unit\n```\n\nCalled when [AppSearchBatchResult](/reference/kotlin/android/app/appsearch/AppSearchBatchResult) results are ready.\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `result` | [AppSearchBatchResult](/reference/kotlin/android/app/appsearch/AppSearchBatchResult)\\\u003cKeyType, ValueType\\\u003e: The result of the executed request. This value cannot be `null`. |\n\n### onSystemError\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onSystemError(throwable: Throwable?): Unit\n```\n\nCalled when a system error occurs.\n\nThis method is only called the infrastructure is fundamentally broken or unavailable, such that none of the requests could be started. For example, it will be called if the AppSearch service unexpectedly fails to initialize and can't be recovered by any means, or if communicating to the server over Binder fails (for example system service crashed or device is rebooting).\n\nThe error is not expected to be recoverable and there is no specific recommended action other than displaying a permanent message to the user.\n\nNormal errors that are caused by invalid inputs or recoverable/retriable situations are reported associated with the input that caused them via the [onResult](#onResult(android.app.appsearch.AppSearchBatchResult)) method.\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `throwable` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?: an exception describing the system error This value may be `null`. |"]]