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!> |
addOnCanceledListener(onCanceledListener: OnCanceledListener)Adds a listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnCanceledListener(Adds an Activity-scoped listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnCanceledListener(Adds a listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnCompleteListener(Adds a listener that is called when the |
Task<LoadBundleTaskProgress!> |
addOnCompleteListener(Adds a listener that is called when the |
Task<LoadBundleTaskProgress!> |
addOnCompleteListener(Adds a listener that is called when the |
Task<LoadBundleTaskProgress!> |
addOnFailureListener(onFailureListener: OnFailureListener)Adds a listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnFailureListener(Adds a listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnFailureListener(Adds a listener that is called if the |
LoadBundleTask |
addOnProgressListener(Adds a listener that is called periodically while the |
LoadBundleTask |
addOnProgressListener(Adds a listener that is called periodically while the |
LoadBundleTask |
addOnProgressListener(Adds a listener that is called periodically while the |
Task<LoadBundleTaskProgress!> |
addOnSuccessListener(onSuccessListener: OnSuccessListener<Any!>)Adds a listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnSuccessListener(Adds a listener that is called if the |
Task<LoadBundleTaskProgress!> |
addOnSuccessListener(Adds a listener that is called if the |
Task<TContinuationResult!> |
<TContinuationResult> continueWith(Returns a new |
Task<TContinuationResult!> |
<TContinuationResult> continueWith(Returns a new |
Task<TContinuationResult!> |
<TContinuationResult> continueWithTask(Returns a new |
Task<TContinuationResult!> |
<TContinuationResult> continueWithTask(Returns a new |
Exception? |
Returns the exception that caused the |
LoadBundleTaskProgress |
Gets the result of the |
LoadBundleTaskProgress |
Gets the result of the |
Boolean |
Returns |
Boolean |
Returns |
Boolean |
Returns |
Task<TContinuationResult!> |
<TContinuationResult> onSuccessTask(Returns a new |
Task<TContinuationResult!> |
<TContinuationResult> onSuccessTask(Returns a new |
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 |
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 |
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 |
| Returns | |
|---|---|
Task<LoadBundleTaskProgress!> |
this |
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 |
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 |
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 |
| Returns | |
|---|---|
Task<LoadBundleTaskProgress!> |
this |
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 |
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 |
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 |
| Returns | |
|---|---|
LoadBundleTask |
this |
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 |
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 |
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 |
| Returns | |
|---|---|
Task<LoadBundleTaskProgress!> |
this |
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 |
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 |
| 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 |
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.
| See also | |
|---|---|
SuccessContinuation |
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 |
| See also | |
|---|---|
SuccessContinuation |