Stay organized with collections
Save and categorize content based on your preferences.
BatchResultCallback
public
interface
BatchResultCallback
android.app.appsearch.BatchResultCallback<KeyType, ValueType>
|
The callback interface to return AppSearchBatchResult
.
Summary
Public methods
onResult
public abstract void onResult (AppSearchBatchResult<KeyType, ValueType> result)
Called when AppSearchBatchResult
results are ready.
Parameters |
result |
AppSearchBatchResult : The result of the executed request.
This value cannot be null . |
onSystemError
public void onSystemError (Throwable throwable)
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(AppSearchBatchResult)
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# BatchResultCallback\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nBatchResultCallback\n===================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/app/appsearch/BatchResultCallback \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nBatchResultCallback\n`\n\n\n`\n\n\n`\n\n|-----------------------------------------------------------------|\n| android.app.appsearch.BatchResultCallback\\\u003cKeyType, ValueType\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe callback interface to return [AppSearchBatchResult](/reference/android/app/appsearch/AppSearchBatchResult).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onResult](/reference/android/app/appsearch/BatchResultCallback#onResult(android.app.appsearch.AppSearchBatchResult\u003cKeyType,ValueType\u003e))`(`[AppSearchBatchResult](/reference/android/app/appsearch/AppSearchBatchResult)`\u003cKeyType, ValueType\u003e result) ` Called when [AppSearchBatchResult](/reference/android/app/appsearch/AppSearchBatchResult) results are ready. |\n| ` default void` | ` `[onSystemError](/reference/android/app/appsearch/BatchResultCallback#onSystemError(java.lang.Throwable))`(`[Throwable](/reference/java/lang/Throwable)` throwable) ` Called when a system error occurs. |\n\nPublic methods\n--------------\n\n### onResult\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onResult (AppSearchBatchResult\u003cKeyType, ValueType\u003e result)\n```\n\nCalled when [AppSearchBatchResult](/reference/android/app/appsearch/AppSearchBatchResult) results are ready.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-------------------------------------------------------------------------------------------------|\n| `result` | `AppSearchBatchResult`: The result of the executed request. This value cannot be `null`. \u003cbr /\u003e |\n\n### onSystemError\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onSystemError (Throwable throwable)\n```\n\nCalled when a system error occurs.\n\nThis method is only called the infrastructure is fundamentally broken or unavailable, such\nthat none of the requests could be started. For example, it will be called if the AppSearch\nservice unexpectedly fails to initialize and can't be recovered by any means, or if\ncommunicating to the server over Binder fails (for example system service crashed or device\nis rebooting).\n\nThe error is not expected to be recoverable and there is no specific recommended action\nother than displaying a permanent message to the user.\n\nNormal errors that are caused by invalid inputs or recoverable/retriable situations are\nreported associated with the input that caused them via the [onResult(AppSearchBatchResult)](/reference/android/app/appsearch/BatchResultCallback#onResult(android.app.appsearch.AppSearchBatchResult\u003cKeyType,ValueType\u003e)) method.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------|\n| `throwable` | `Throwable`: an exception describing the system error This value may be `null`. \u003cbr /\u003e |"]]