java.lang.Object | ||||
↳ | com.google.android.gms.tasks.Task<TResult extends com.google.firebase.storage.StorageTask.ProvideError> | |||
↳ | com.google.firebase.storage.CancellableTask<TResult extends com.google.firebase.storage.StorageTask.ProvideError> | |||
↳ | com.google.firebase.storage.ControllableTask<TResult extends com.google.firebase.storage.StorageTask.ProvideError> | |||
↳ | com.google.firebase.storage.StorageTask<TResult extends com.google.firebase.storage.StorageTask.ProvideError> |
![]() |
A controllable Task that has a synchronized state machine.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StorageTask.ProvideError | An object that returns an exception. | ||||||||||
StorageTask.SnapshotBase | Base class for state. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mSyncObject |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a listener that is called when the Task succeeds or fails.
| |||||||||||
Adds a listener that is called when the Task succeeds or fails.
| |||||||||||
Adds a listener that is called when the Task succeeds or fails.
| |||||||||||
Adds a listener that is called if the Task fails.
| |||||||||||
Adds a listener that is called if the Task fails.
| |||||||||||
Adds a listener that is called if the Task fails.
| |||||||||||
Adds a listener that is called when the Task becomes paused.
| |||||||||||
Adds a listener that is called when the Task becomes paused.
| |||||||||||
Adds a listener that is called when the Task becomes paused.
| |||||||||||
Adds a listener that is called periodically while the ControllableTask executes.
| |||||||||||
Adds a listener that is called periodically while the ControllableTask executes.
| |||||||||||
Adds a listener that is called periodically while the ControllableTask executes.
| |||||||||||
Adds a listener that is called if the Task completes successfully.
| |||||||||||
Adds a listener that is called if the Task completes successfully.
| |||||||||||
Adds a listener that is called if the Task completes successfully.
| |||||||||||
Attempts to cancel the task.
| |||||||||||
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
| |||||||||||
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
| |||||||||||
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
| |||||||||||
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
| |||||||||||
Returns the exception that caused the Task to fail.
| |||||||||||
Gets the result of the Task, if it has already completed.
| |||||||||||
Gets the result of the Task, if it has already completed.
| |||||||||||
Returns the current state of the task.
| |||||||||||
Returns
true if the task has been canceled. | |||||||||||
Returns
true if the Task is complete; false otherwise. | |||||||||||
Returns
true if the task is currently running. | |||||||||||
Returns
true if the task has been paused. | |||||||||||
Returns
true if the Task has completed successfully; false otherwise. | |||||||||||
Attempts to pause the task.
| |||||||||||
Removes a listener.
| |||||||||||
Removes a listener.
| |||||||||||
Removes a listener.
| |||||||||||
Removes a listener.
| |||||||||||
Removes a listener.
| |||||||||||
Attempts to resume a paused task.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
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.
Parameters | |
---|---|
listener |
OnCompleteListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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. |
listener |
OnCompleteListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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 |
listener |
OnCompleteListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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. |
listener |
OnFailureListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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.
Parameters | |
---|---|
listener |
OnFailureListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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 |
listener |
OnFailureListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Adds a listener that is called when the Task becomes paused.
Parameters | |
---|---|
executor |
Executor :
the executor to use to call the listener |
listener |
OnPausedListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Adds a listener that is called when the Task becomes paused.
Parameters | |
---|---|
activity |
Activity :
When the supplied Activity stops, this listener will automatically
be removed. |
listener |
OnPausedListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Adds a listener that is called when the Task becomes paused.
Parameters | |
---|---|
listener |
OnPausedListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Adds a listener that is called periodically while the ControllableTask executes.
Parameters | |
---|---|
executor |
Executor :
the executor to use to call the listener |
listener |
OnProgressListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Adds a listener that is called periodically while the ControllableTask executes.
Parameters | |
---|---|
listener |
OnProgressListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Adds a listener that is called periodically while the ControllableTask executes.
Parameters | |
---|---|
activity |
Activity :
When the supplied Activity stops, this listener will automatically
be removed. |
listener |
OnProgressListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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.
Parameters | |
---|---|
listener |
OnSuccessListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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. |
listener |
OnSuccessListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
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 |
listener |
OnSuccessListener
|
Returns | |
---|---|
StorageTask<TResult> |
this Task |
Attempts to cancel the task. A canceled task cannot be resumed later.
Returns | |
---|---|
boolean |
true if this task is successfully being canceled.
|
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.
Parameters | |
---|---|
continuation |
Continuation
|
Returns | |
---|---|
Task<TContinuationResult> |
See also:
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 |
continuation |
Continuation
|
Returns | |
---|---|
Task<TContinuationResult> |
See also:
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 |
continuation |
Continuation
|
Returns | |
---|---|
Task<TContinuationResult> |
See also:
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.
Parameters | |
---|---|
continuation |
Continuation
|
Returns | |
---|---|
Task<TContinuationResult> |
See also:
Returns the exception that caused the Task to fail. Returns null
if the Task is not yet complete, or completed successfully.
Returns | |
---|---|
Exception |
Gets the result of the Task, if it has already completed.
Returns | |
---|---|
TResult |
Throws | |
---|---|
IllegalStateException |
if the Task is not yet complete |
RuntimeExecutionException |
if the Task failed with an exception |
Gets the result of the Task, if it has already completed.
Parameters | |
---|---|
exceptionType |
Class
|
Returns | |
---|---|
TResult |
Throws | |
---|---|
IllegalStateException |
if the Task is not yet complete |
|
if the Task failed with an exception of type X |
RuntimeExecutionException |
if the Task failed with an exception that was not of type X |
Throwable |
Returns the current state of the task. This method will return state at any point of the tasks execution and may not be the final result..
Returns | |
---|---|
TResult |
Returns true
if the task has been canceled.
Returns | |
---|---|
boolean |
true if the task has been canceled. |
Returns true
if the Task is complete; false
otherwise.
Returns | |
---|---|
boolean |
Returns true
if the task is currently running.
Returns | |
---|---|
boolean |
true if the task is currently running. |
Returns true
if the task has been paused.
Returns | |
---|---|
boolean |
true if the task has been paused. |
Returns true
if the Task has completed successfully; false
otherwise.
Returns | |
---|---|
boolean |
Attempts to pause the task. A paused task can later be resumed.
Returns | |
---|---|
boolean |
true if this task is successfully being paused. Note that a task may not
be immediately paused if it was executing another action and can still fail or complete.
|
Attempts to resume a paused task.
Returns | |
---|---|
boolean |
true if the task is successfully resumed. false
if the task has an unrecoverable error or has entered another
state that precludes resume.
|