BatchResultCallback
Stay organized with collections
Save and categorize content based on your preferences.
Public Methods
public abstract void
onResult
( AppSearchBatchResult
<KeyType, ValueType>
result)
Parameters
result
The result of the executed request.
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
an exception describing the system error
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 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 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eBatchResultCallback\u003c/code\u003e is an interface used to receive results from AppSearch batch operations.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eonResult\u003c/code\u003e is called when the \u003ccode\u003eAppSearchBatchResult\u003c/code\u003e is ready, providing the outcome of the operation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eonSystemError\u003c/code\u003e is called only for unrecoverable system errors, indicating a fundamental issue with the infrastructure.\u003c/p\u003e\n"]]],["The `BatchResultCallback` interface handles results from `AppSearchBatchResult`. It defines two methods: `onResult` and `onSystemError`. `onResult` is triggered when `AppSearchBatchResult` data is available, providing the request's outcome. `onSystemError` is invoked upon encountering a critical system failure preventing any request execution, indicating a non-recoverable situation, unlike normal, recoverable errors. `onSystemError` passes details about the failure through the `throwable` parameter.\n"],null,["# BatchResultCallback\n\npublic interface **BatchResultCallback** \nThe callback interface to return [AppSearchBatchResult](/android/reference/com/google/android/gms/appsearch/AppSearchBatchResult). \n\n### Public Method Summary\n\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [onResult](/android/reference/com/google/android/gms/appsearch/BatchResultCallback#onResult(com.google.android.gms.appsearch.AppSearchBatchResult\u003cKeyType,%20ValueType\u003e))([AppSearchBatchResult](/android/reference/com/google/android/gms/appsearch/AppSearchBatchResult)\\\u003cKeyType, ValueType\\\u003e result) Called when [AppSearchBatchResult](/android/reference/com/google/android/gms/appsearch/AppSearchBatchResult) results are ready. |\n| void | [onSystemError](/android/reference/com/google/android/gms/appsearch/BatchResultCallback#onSystemError(java.lang.Throwable))([Throwable](//developer.android.com/reference/java/lang/Throwable.html) throwable) Called when a system error occurs. |\n\nPublic Methods\n--------------\n\n#### public abstract void **onResult** ([AppSearchBatchResult](/android/reference/com/google/android/gms/appsearch/AppSearchBatchResult)\\\u003cKeyType, ValueType\\\u003e result)\n\nCalled when [AppSearchBatchResult](/android/reference/com/google/android/gms/appsearch/AppSearchBatchResult)\nresults are ready. \n\n##### Parameters\n\n| result | The result of the executed request. |\n|--------|-------------------------------------|\n\n#### public void **onSystemError** ([Throwable](//developer.android.com/reference/java/lang/Throwable.html) throwable)\n\nCalled when a system error occurs.\n\nThis method is only called the infrastructure is fundamentally broken or\nunavailable, such that none of the requests could be started. For example, it will be\ncalled if the AppSearch service unexpectedly fails to initialize and can't be recovered\nby any means, or if communicating to the server over Binder fails (for example system\nservice crashed or device is rebooting).\n\nThe error is not expected to be recoverable and there is no specific recommended\naction other than displaying a permanent message to the user.\n\nNormal errors that are caused by invalid inputs or recoverable/retriable situations\nare reported associated with the input that caused them via the [onResult(AppSearchBatchResult)](/android/reference/com/google/android/gms/appsearch/BatchResultCallback#onResult(com.google.android.gms.appsearch.AppSearchBatchResult\u003cKeyType,%20ValueType\u003e)) method. \n\n##### Parameters\n\n| throwable | an exception describing the system error |\n|-----------|------------------------------------------|"]]