LoadBundleTask

classLoadBundleTask :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 theTask is canceled.

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

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

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

Adds a listener that is called if theTask is canceled.

Task<LoadBundleTaskProgress!>

Adds a listener that is called when theTask succeeds or fails.

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

Adds a listener that is called when theTask succeeds or fails.

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

Adds a listener that is called when theTask succeeds or fails.

Task<LoadBundleTaskProgress!>

Adds a listener that is called if theTask fails.

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

Adds a listener that is called if theTask fails.

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

Adds a listener that is called if theTask fails.

LoadBundleTask

Adds a listener that is called periodically while theLoadBundleTask executes.

LoadBundleTask

Adds a listener that is called periodically while theLoadBundleTask executes.

LoadBundleTask

Adds a listener that is called periodically while theLoadBundleTask executes.

Task<LoadBundleTaskProgress!>

Adds a listener that is called if theTask completes successfully.

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

Adds a listener that is called if theTask completes successfully.

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

Adds a listener that is called if theTask completes successfully.

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

Returns a newTask 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 newTask that will be completed with the result of applying the specifiedContinuation to this Task.

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

Returns a newTask that will be completed with the result of applying the specifiedContinuation to this Task.

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

Returns a newTask that will be completed with the result of applying the specifiedContinuation to this Task.

Exception?

Returns the exception that caused theTask to fail.

LoadBundleTaskProgress

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

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

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

Boolean

Returnstrue if the task has been canceled.

Boolean

Returnstrue if theTask is complete;false otherwise.

Boolean

Returnstrue if theTask has completed successfully;false otherwise.

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

Returns a newTask that will be completed with the result of applying the specifiedSuccessContinuation to thisTask when thisTask completes successfully.

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

Returns a newTask that will be completed with the result of applying the specifiedSuccessContinuation to thisTask when thisTask completes successfully.

Public functions

addOnCanceledListener

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

Adds a listener that is called if theTask is canceled.

The listener will be called on main application thread. If theTask 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!>

thisTask

addOnCanceledListener

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

Adds an Activity-scoped listener that is called if theTask 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 duringonStop.

Returns
Task<LoadBundleTaskProgress!>

this Task

addOnCanceledListener

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

Adds a listener that is called if theTask 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 theTask 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!>

thisTask

addOnCompleteListener

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

Adds a listener that is called when theTask 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 suppliedActivity stops, this listener will automatically be removed.

Returns
Task<LoadBundleTaskProgress!>

thisTask

addOnCompleteListener

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

Adds a listener that is called when theTask 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!>

thisTask

addOnFailureListener

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

Adds a listener that is called if theTask 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!>

thisTask

addOnFailureListener

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

Adds a listener that is called if theTask 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 suppliedActivity stops, this listener will automatically be removed.

Returns
Task<LoadBundleTaskProgress!>

thisTask

addOnFailureListener

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

Adds a listener that is called if theTask 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!>

thisTask

addOnProgressListener

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

Adds a listener that is called periodically while theLoadBundleTask 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 duringonStop.

Returns
LoadBundleTask

thisTask

addOnProgressListener

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

Adds a listener that is called periodically while theLoadBundleTask 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 duringonStop.

Parameters
activity: Activity

When the suppliedActivity stops, this listener will automatically be removed.

Returns
LoadBundleTask

thisTask

addOnProgressListener

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

Adds a listener that is called periodically while theLoadBundleTask 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

thisTask

addOnSuccessListener

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

Adds a listener that is called if theTask 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!>

thisTask

addOnSuccessListener

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

Adds a listener that is called if theTask 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 suppliedActivity stops, this listener will automatically be removed.

Returns
Task<LoadBundleTaskProgress!>

thisTask

addOnSuccessListener

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

Adds a listener that is called if theTask 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!>

thisTask

continueWith

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

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

TheContinuation 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 newTask that will be completed with the result of applying the specifiedContinuation 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 newTask that will be completed with the result of applying the specifiedContinuation 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 newTask that will be completed with the result of applying the specifiedContinuation to this Task.

Parameters
executor: Executor

the executor to use to call theContinuation

See also
then

getException

fun getException(): Exception?

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

getResult

fun getResult(): LoadBundleTaskProgress

Gets the result of theTask, 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 theTask, 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

Returnstrue if the task has been canceled.

isComplete

fun isComplete(): Boolean

Returnstrue if theTask is complete;false otherwise.

isSuccessful

fun isSuccessful(): Boolean

Returnstrue if theTask has completed successfully;false otherwise.

onSuccessTask

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

Returns a newTask that will be completed with the result of applying the specifiedSuccessContinuation to thisTask when thisTask completes successfully. If the previousTask fails, theonSuccessTask completion will be skipped and failure listeners will be invoked.

TheSuccessContinuation will be called on the main application thread.

If the previousTask is canceled, the returned Task will also be canceled and theSuccessContinuation would not execute.

onSuccessTask

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

Returns a newTask that will be completed with the result of applying the specifiedSuccessContinuation to thisTask when thisTask completes successfully. If the previousTask fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.

If the previousTask is canceled, the returnedTask will also be canceled and theSuccessContinuation would not execute.

Parameters
executor: Executor

the executor to use to call the SuccessContinuation

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.