Known Direct Subclasses
ControllableTask<StateT>
|
Known Indirect Subclasses
FileDownloadTask,
StorageTask<ResultT extends StorageTask.ProvideError>,
StreamDownloadTask,
UploadTask
|
Represents an asynchronous operation that can be canceled.
Public Constructor Summary
Public Method Summary
abstract CancellableTask<StateT> |
addOnProgressListener(OnProgressListener<? super StateT>
listener)
Adds a listener that is called periodically while the ControllableTask
executes.
|
abstract CancellableTask<StateT> |
addOnProgressListener(Activity
activity, OnProgressListener<? super StateT>
listener)
Adds a listener that is called periodically while the ControllableTask
executes.
|
abstract CancellableTask<StateT> |
addOnProgressListener(Executor
executor, OnProgressListener<? super StateT>
listener)
Adds a listener that is called periodically while the ControllableTask
executes.
|
abstract boolean |
cancel()
Attempts to cancel the task.
|
abstract boolean | |
abstract boolean |
Inherited Method Summary
Public Constructors
Public Methods
public abstract CancellableTask<StateT> addOnProgressListener (OnProgressListener<? super StateT> listener)
Adds a listener that is called periodically while the ControllableTask executes.
Returns
- this Task
public abstract CancellableTask<StateT> addOnProgressListener (Activity activity, OnProgressListener<? super StateT> listener)
Adds a listener that is called periodically while the ControllableTask executes.
Parameters
activity | When the supplied Activity
stops, this listener will automatically be removed. |
---|---|
listener |
Returns
- this Task
public abstract CancellableTask<StateT> addOnProgressListener (Executor executor, OnProgressListener<? super StateT> listener)
Adds a listener that is called periodically while the ControllableTask executes.
Parameters
executor | the executor to use to call the listener |
---|---|
listener |
Returns
- this Task
public abstract boolean cancel ()
Attempts to cancel the task. A canceled task cannot be resumed later. A canceled
task calls back on listeners subscribed to
addOnFailureListener(OnFailureListener)
with an exception that indicates the
task was canceled.
Returns
- true if this task was successfully canceled or is in the process of being canceled. Returns false if the task is already completed or in a state that cannot be canceled.
public abstract boolean isCanceled ()
Returns
- true if the task has been canceled.
public abstract boolean isInProgress ()
Returns
- true if the task is currently running.