PendingResults | Android Developers

Quicknav Quicknav
Links

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

Android Sites

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

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Methods | Inherited Methods | [Expand All]
public final class

# PendingResults

extends Object

java.lang.Object
↳ | com.google.android.gms.common.api.PendingResults

## Class Overview

Provides factory methods for `PendingResult` instances, primarily for use in tests.

## Summary

Public Methods
static PendingResult<Status> | canceledPendingResult() Returns a `PendingResult` that has been canceled.
static <R extends Result> PendingResult<R> | canceledPendingResult(R result) Returns a `PendingResult` that has been canceled.
static PendingResult<Status> | immediatePendingResult(Status result) Returns a `PendingResult` with the specified `Status`.
static <R extends Result> PendingResult<R> | immediatePendingResult(R result) Returns a `PendingResult` with the specified result.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Public Methods

#### public static PendingResult<Status> canceledPendingResult ()

Returns a `PendingResult` that has been canceled.

#### public static PendingResult<R> canceledPendingResult (R result)

Returns a `PendingResult` that has been canceled.

##### Parameters

result | The canceled result. Must have a status code of `CANCELED`.

#### public static PendingResult<Status> immediatePendingResult (Status result)

Returns a `PendingResult` with the specified `Status`.

If `setResultCallback(ResultCallback)` is called on the returned PendingResult then `onResult(R)` will immediately be called on the main thread. If `await()` is called it will immediate return `result`.

#### public static PendingResult<R> immediatePendingResult (R result)

Returns a `PendingResult` with the specified result.

If `setResultCallback(ResultCallback)` is called on the returned PendingResult then `onResult(R)` will immediately be called on the main thread. If `await()` is called it will immediate return `result`.

Calling `cancel()` on the returned PendingResult is not supported.