Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

Tasks

public final class Tasks
extends Object

java.lang.Object
   ↳ com.google.android.play.core.tasks.Tasks


Task utility methods.

Summary

Public methods

static <TResult> TResult await(Task<TResult> task, long timeout, TimeUnit unit)

Blocks until the specified Task is complete.

static <TResult> TResult await(Task<TResult> task)

Blocks until the specified Task is complete.

Inherited methods

From class java.lang.Object

Public methods

await

TResult await (Task<TResult> task, 
                long timeout, 
                TimeUnit unit)

Blocks until the specified Task is complete.

Parameters
task Task

timeout long

unit TimeUnit

Returns
TResult the Task's result

Throws
ExecutionException if the Task fails
InterruptedException if an interrupt occurs while waiting for the Task to complete
TimeoutException if the specified timeout is reached before the Task completes

await

TResult await (Task<TResult> task)

Blocks until the specified Task is complete.

Parameters
task Task

Returns
TResult the Task's result

Throws
ExecutionException if the Task fails
InterruptedException if an interrupt occurs while waiting for the Task to complete