LoadBundleTask

class LoadBundleTask : Task


Represents the task of loading a Firestore bundle. It provides progress of bundle loading, as well as task completion and error events.

Summary

Public functions

Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task is canceled.

Task<LoadBundleTaskProgress!>
addOnCanceledListener(
    activity: Activity,
    onCanceledListener: OnCanceledListener
)

Adds an Activity-scoped listener that is called if the Task is canceled.

Task<LoadBundleTaskProgress!>
addOnCanceledListener(
    executor: Executor,
    onCanceledListener: OnCanceledListener
)

Adds a listener that is called if the Task is canceled.

Task<LoadBundleTaskProgress!>

Adds a listener that is called when the Task succeeds or fails.

Task<LoadBundleTaskProgress!>
addOnCompleteListener(
    activity: Activity,
    onCompleteListener: OnCompleteListener<LoadBundleTaskProgress!>
)

Adds a listener that is called when the Task succeeds or fails.

Task<LoadBundleTaskProgress!>
addOnCompleteListener(
    executor: Executor,
    onCompleteListener: OnCompleteListener<LoadBundleTaskProgress!>
)

Adds a listener that is called when the Task succeeds or fails.

Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task fails.

Task<LoadBundleTaskProgress!>
addOnFailureListener(
    activity: Activity,
    onFailureListener: OnFailureListener
)

Adds a listener that is called if the Task fails.

Task<LoadBundleTaskProgress!>
addOnFailureListener(
    executor: Executor,
    onFailureListener: OnFailureListener
)

Adds a listener that is called if the Task fails.

LoadBundleTask

Adds a listener that is called periodically while the LoadBundleTask executes.

LoadBundleTask

Adds a listener that is called periodically while the LoadBundleTask executes.

LoadBundleTask

Adds a listener that is called periodically while the LoadBundleTask executes.

Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task completes successfully.

Task<LoadBundleTaskProgress!>
addOnSuccessListener(
    activity: Activity,
    onSuccessListener: OnSuccessListener<Any!>
)

Adds a listener that is called if the Task completes successfully.

Task<LoadBundleTaskProgress!>
addOnSuccessListener(
    executor: Executor,
    onSuccessListener: OnSuccessListener<Any!>
)

Adds a listener that is called if the Task completes successfully.

Task<TContinuationResult!>
<TContinuationResult> continueWith(
    continuation: Continuation<LoadBundleTaskProgress!, TContinuationResult!>
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

Task<TContinuationResult!>
<TContinuationResult> continueWith(
    executor: Executor,
    continuation: Continuation<LoadBundleTaskProgress!, TContinuationResult!>
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

Task<TContinuationResult!>
<TContinuationResult> continueWithTask(
    continuation: Continuation<LoadBundleTaskProgress!, Task<TContinuationResult!>!>
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

Task<TContinuationResult!>
<TContinuationResult> continueWithTask(
    executor: Executor,
    continuation: Continuation<LoadBundleTaskProgress!, Task<TContinuationResult!>!>
)

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

Exception?

Returns the exception that caused the Task to fail.

LoadBundleTaskProgress

Gets the result of the Task, if it has already completed.

LoadBundleTaskProgress
<X : Throwable?> getResult(exceptionType: Class<X!>)

Gets the result of the Task, if it has already completed.

Boolean

Returns true if the task has been canceled.

Boolean

Returns true if the Task is complete; false otherwise.

Boolean

Returns true if the Task has completed successfully; false otherwise.

Task<TContinuationResult!>
<TContinuationResult> onSuccessTask(
    successContinuation: SuccessContinuation<LoadBundleTaskProgress!, TContinuationResult!>
)

Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully.

Task<TContinuationResult!>
<TContinuationResult> onSuccessTask(
    executor: Executor,
    successContinuation: SuccessContinuation<LoadBundleTaskProgress!, TContinuationResult!>
)

Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully.

Public functions

addOnCanceledListener

fun addOnCanceledListener(onCanceledListener: OnCanceledListener): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task is canceled.

The listener will be called on main application thread. If the Task has already been canceled, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnCanceledListener

fun addOnCanceledListener(
    activity: Activity,
    onCanceledListener: OnCanceledListener
): Task<LoadBundleTaskProgress!>

Adds an Activity-scoped listener that is called if the Task is canceled.

The listener will be called on main application thread. If the task has already been canceled, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

The listener will be automatically removed during onStop.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnCanceledListener

fun addOnCanceledListener(
    executor: Executor,
    onCanceledListener: OnCanceledListener
): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task is canceled.

If the task has already been canceled, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Parameters
executor: Executor

the executor to use to call the listener

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnCompleteListener

fun addOnCompleteListener(
    onCompleteListener: OnCompleteListener<LoadBundleTaskProgress!>
): Task<LoadBundleTaskProgress!>

Adds a listener that is called when the Task succeeds or fails.

The listener will be called on main application thread. If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnCompleteListener

fun addOnCompleteListener(
    activity: Activity,
    onCompleteListener: OnCompleteListener<LoadBundleTaskProgress!>
): Task<LoadBundleTaskProgress!>

Adds a listener that is called when the Task succeeds or fails.

If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Parameters
activity: Activity

When the supplied Activity stops, this listener will automatically be removed.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnCompleteListener

fun addOnCompleteListener(
    executor: Executor,
    onCompleteListener: OnCompleteListener<LoadBundleTaskProgress!>
): Task<LoadBundleTaskProgress!>

Adds a listener that is called when the Task succeeds or fails.

If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Parameters
executor: Executor

the executor to use to call the listener

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnFailureListener

fun addOnFailureListener(onFailureListener: OnFailureListener): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task fails.

The listener will be called on main application thread. If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnFailureListener

fun addOnFailureListener(
    activity: Activity,
    onFailureListener: OnFailureListener
): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task fails.

If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Parameters
activity: Activity

When the supplied Activity stops, this listener will automatically be removed.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnFailureListener

fun addOnFailureListener(
    executor: Executor,
    onFailureListener: OnFailureListener
): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task fails.

If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Parameters
executor: Executor

the executor to use to call the listener

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnProgressListener

fun addOnProgressListener(
    listener: OnProgressListener<LoadBundleTaskProgress!>
): LoadBundleTask

Adds a listener that is called periodically while the LoadBundleTask executes.

The listener will be called on main application thread. If multiple listeners are added, they will be called in the order in which they were added.

The listener will be automatically removed during onStop.

Returns
LoadBundleTask

this Task

addOnProgressListener

fun addOnProgressListener(
    activity: Activity,
    listener: OnProgressListener<LoadBundleTaskProgress!>
): LoadBundleTask

Adds a listener that is called periodically while the LoadBundleTask executes.

The listener will be called on main application thread. If multiple listeners are added, they will be called in the order in which they were added.

The listener will be automatically removed during onStop.

Parameters
activity: Activity

When the supplied Activity stops, this listener will automatically be removed.

Returns
LoadBundleTask

this Task

addOnProgressListener

fun addOnProgressListener(
    executor: Executor,
    listener: OnProgressListener<LoadBundleTaskProgress!>
): LoadBundleTask

Adds a listener that is called periodically while the LoadBundleTask executes.

If multiple listeners are added, they will be called in the order in which they were added.

Parameters
executor: Executor

the executor to use to call the listener

Returns
LoadBundleTask

this Task

addOnSuccessListener

fun addOnSuccessListener(onSuccessListener: OnSuccessListener<Any!>): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task completes successfully. The listener will be called on the main application thread. If the task has already completed successfully, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnSuccessListener

fun addOnSuccessListener(
    activity: Activity,
    onSuccessListener: OnSuccessListener<Any!>
): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task completes successfully.

If multiple listeners are added, they will be called in the order in which they were added. If the task has already completed successfully, a call to the listener will be immediately scheduled.

Parameters
activity: Activity

When the supplied Activity stops, this listener will automatically be removed.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnSuccessListener

fun addOnSuccessListener(
    executor: Executor,
    onSuccessListener: OnSuccessListener<Any!>
): Task<LoadBundleTaskProgress!>

Adds a listener that is called if the Task completes successfully.

If multiple listeners are added, they will be called in the order in which they were added. If the task has already completed successfully, a call to the listener will be immediately scheduled.

Parameters
executor: Executor

the executor to use to call the listener

Returns
Task<LoadBundleTaskProgress!>

this Task

continueWith

fun <TContinuationResult> continueWith(
    continuation: Continuation<LoadBundleTaskProgress!, TContinuationResult!>
): Task<TContinuationResult!>

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

The Continuation will be called on the main application thread.

See also
then

continueWith

fun <TContinuationResult> continueWith(
    executor: Executor,
    continuation: Continuation<LoadBundleTaskProgress!, TContinuationResult!>
): Task<TContinuationResult!>

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

Parameters
executor: Executor

the executor to use to call the Continuation

See also
then

continueWithTask

fun <TContinuationResult> continueWithTask(
    continuation: Continuation<LoadBundleTaskProgress!, Task<TContinuationResult!>!>
): Task<TContinuationResult!>

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

The Continuation will be called on the main application thread.

See also
then

continueWithTask

fun <TContinuationResult> continueWithTask(
    executor: Executor,
    continuation: Continuation<LoadBundleTaskProgress!, Task<TContinuationResult!>!>
): Task<TContinuationResult!>

Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.

Parameters
executor: Executor

the executor to use to call the Continuation

See also
then

getException

fun getException(): Exception?

Returns the exception that caused the Task to fail. Returns null if the Task is not yet complete, or completed successfully.

getResult

fun getResult(): LoadBundleTaskProgress

Gets the result of the Task, if it has already completed.

Throws
java.lang.IllegalStateException: java.lang.IllegalStateException

if the Task is not yet complete

com.google.android.gms.tasks.RuntimeExecutionException: com.google.android.gms.tasks.RuntimeExecutionException

if the Task failed with an exception

getResult

fun <X : Throwable?> getResult(exceptionType: Class<X!>): LoadBundleTaskProgress

Gets the result of the Task, if it has already completed.

Throws
java.lang.IllegalStateException: java.lang.IllegalStateException

if the Task is not yet complete

X: X

if the Task failed with an exception of type X

com.google.android.gms.tasks.RuntimeExecutionException: com.google.android.gms.tasks.RuntimeExecutionException

if the Task failed with an exception that was not of type X

isCanceled

fun isCanceled(): Boolean

Returns true if the task has been canceled.

isComplete

fun isComplete(): Boolean

Returns true if the Task is complete; false otherwise.

isSuccessful

fun isSuccessful(): Boolean

Returns true if the Task has completed successfully; false otherwise.

onSuccessTask

fun <TContinuationResult> onSuccessTask(
    successContinuation: SuccessContinuation<LoadBundleTaskProgress!, TContinuationResult!>
): Task<TContinuationResult!>

Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully. If the previous Task fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.

The SuccessContinuation will be called on the main application thread.

If the previous Task is canceled, the returned Task will also be canceled and the SuccessContinuation would not execute.

onSuccessTask

fun <TContinuationResult> onSuccessTask(
    executor: Executor,
    successContinuation: SuccessContinuation<LoadBundleTaskProgress!, TContinuationResult!>
): Task<TContinuationResult!>

Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully. If the previous Task fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.

If the previous Task is canceled, the returned Task will also be canceled and the SuccessContinuation would not execute.

Parameters
executor: Executor

the executor to use to call the SuccessContinuation