Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
public interface

# PendingResult

com.google.android.gms.common.api.PendingResult<R extends com.google.android.gms.common.api.Result>

## Class Overview

Represents a pending result from calling an API method in Google Play services. The final result object from a PendingResult<R> is of type R, which can be retrieved in one of two ways.

- via blocking calls to `await()`, or `await(long, TimeUnit)`, or
- via a callback by passing in an object implementing interface `ResultCallback` to `setResultCallback(ResultCallback<R>)`.

After the result has been retrieved using `await()` or delivered to the result callback, it is an error to to attempt to retrieve the result again. It is the responsibility of the caller or callback receiver to release any resources associated with the returned result. Some result types may implement `Releasable`, in which case `release()` should be used to free the associated resources.

## Summary

Public Methods
abstract R | await() Blocks until the task is completed.
abstract R | await(long time, TimeUnit units) Blocks until the task is completed or has timed out waiting for the result.
abstract void | setResultCallback(ResultCallback<R> callback) Set the callback here if you want the result to be delivered via a callback when the result is ready.

## Public Methods

#### public abstract R await ()

Blocks until the task is completed. This is not allowed on the UI thread. The returned result object can have an additional failure mode of `INTERRUPTED`.

#### public abstract R await (long time, TimeUnit units)

Blocks until the task is completed or has timed out waiting for the result. This is not allowed on the UI thread. The returned result object can have an additional failure mode of `INTERRUPTED`.

#### public abstract void setResultCallback (ResultCallback<R> callback)

Set the callback here if you want the result to be delivered via a callback when the result is ready.