Stay organized with collections Save and categorize content based on your preferences.
public abstract class ResultCallbacks<R extends Result> implements ResultCallback
Callbacks for receiving a Result
from a as an asynchronous callback. Contains separate callbacks for success and failure.
These methods are called on the main thread, unless overridden by setHandler
.
public abstract void onFailure(@NonNull Status result)
Called when the Result
is ready and a failure occurred.
@NonNull Status result
Status resulting from the API call. Guaranteed to be non-null and unsuccessful.
public abstract void onSuccess(@NonNull R result)
Called when the Result
is ready and was successful.
It is the responsibility of the callback to release any resources associated with the result if onSuccess
is called. Some result types may implement Releasable
, in which case release
should be used to free the associated resources. If a failure occurs the result will be released automatically.
@NonNull R result
The result from the API call. Never null.
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."],[[["`ResultCallbacks` provides a way to handle asynchronous results from API calls, with separate callbacks for success (`onSuccess`) and failure (`onFailure`)."],["These callbacks are executed on the main thread by default but can be overridden using a custom handler."],["`onFailure` is called with a non-null, unsuccessful `Status` object when the API call fails."],["`onSuccess` is called with a non-null `Result` object when the API call is successful, and the callback is responsible for releasing any associated resources."],["`ResolvingResultCallbacks` is a subclass that automatically handles resolutions for failures."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4