ResolvingResultCallbacks

public abstract class ResolvingResultCallbacks<R extends Result> extends ResultCallbacks


ResultCallbacks which automatically start resolutions for failures. Contains separate callbacks for success and unresolvable failures.

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

Summary

Protected constructors

ResolvingResultCallbacks(@NonNull Activity activity, int requestCode)

Create new callbacks that automatically resolve failure.

Public methods

abstract void
onSuccess(@NonNull R result)

Called when the is ready and was successful.

abstract void

Called when a non-resolvable failure occurs or starting a resolution fails.

Protected constructors

ResolvingResultCallbacks

protected ResolvingResultCallbacks(@NonNull Activity activity, int requestCode)

Create new callbacks that automatically resolve failure.

Parameters
@NonNull Activity activity

Activity to use for displaying UI to resolve failures. This activity will receive a call to onActivityResult with the given request code when the user completes a resolution.

int requestCode

If >= 0, this code will be passed to onActivityResult after the user completes a resolution.

Public methods

onSuccess

public abstract void onSuccess(@NonNull R result)

Called when the 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 , in which case Releasable#release should be used to free the associated resources. If a failure occurs the result will be released automatically.

onUnresolvableFailure

public abstract void onUnresolvableFailure(@NonNull Status result)

Called when a non-resolvable failure occurs or starting a resolution fails.

Parameters
@NonNull Status result

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