public class

TaskCompletionSource

extends Object
java.lang.Object
   ↳ com.google.android.gms.tasks.TaskCompletionSource<TResult>

Class Overview

Provides the ability to create an incomplete Task and later complete it by either calling setResult(TResult) or setException(Exception).

Summary

Public Constructors
TaskCompletionSource()
Public Methods
Task<TResult> getTask()
Returns the Task.
void setException(Exception e)
Completes the Task with the specified exception.
void setResult(TResult result)
Completes the Task with the specified result.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TaskCompletionSource ()

Public Methods

public Task<TResult> getTask ()

Returns the Task.

public void setException (Exception e)

Completes the Task with the specified exception.

Throws
IllegalStateException if the Task is already complete

public void setResult (TResult result)

Completes the Task with the specified result.

Throws
IllegalStateException if the Task is already complete