ResultCallbacks

Kotlin|Java

public abstract classResultCallbacks<R extends Result> implementsResultCallback

Known direct subclasses
ResolvingResultCallbacks

ResultCallbacks which automatically start resolutions for failures.


Callbacks for receiving aResult from a as an asynchronous callback. Contains separate callbacks for success and failure.

These methods are called on the main thread, unless overridden bysetHandler.

Summary

Public constructors

Public methods

abstract void

Called when theResult is ready and a failure occurred.

abstract void
onSuccess(@NonNull R result)

Called when theResult is ready and was successful.

Public constructors

ResultCallbacks

public ResultCallbacks()

Public methods

onFailure

public abstract void onFailure(@NonNullStatus result)

Called when theResult is ready and a failure occurred.

Parameters
@NonNullStatus result

Status resulting from the API call. Guaranteed to be non-null and unsuccessful.

onSuccess

public abstract void onSuccess(@NonNull R result)

Called when theResult is ready and was successful.

It is the responsibility of the callback to release any resources associated with the result ifonSuccess is called. Some result types may implementReleasable, in which caserelease should be used to free the associated resources. If a failure occurs the result will be released automatically.

Parameters
@NonNull R result

The result from the API call. Never null.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.