Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

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