Also: Google
Play services
public abstract class ControllableTask extends CancellableTask<StateT>
Known Direct Subclasses
StorageTask<ResultT extends StorageTask.ProvideError>
|
Known Indirect Subclasses |
Represents an asynchronous operation that can be paused, resumed and canceled. This task also receives progress and other state change notifications.
Public Constructor Summary
Public Method Summary
abstract ControllableTask<StateT> |
addOnPausedListener(Activity
activity, OnPausedListener<? super StateT>
listener)
Adds a listener that is called when the Task becomes paused.
|
abstract ControllableTask<StateT> |
addOnPausedListener(OnPausedListener<? super StateT>
listener)
Adds a listener that is called when the Task becomes paused.
|
abstract ControllableTask<StateT> |
addOnPausedListener(Executor
executor, OnPausedListener<? super StateT>
listener)
Adds a listener that is called when the Task becomes paused.
|
abstract boolean |
isPaused()
|
abstract boolean |
pause()
Attempts to pause the task.
|
abstract boolean |
resume()
Attempts to resume this task.
|
Inherited Method Summary
Public Constructors
Public Methods
public abstract ControllableTask<StateT> addOnPausedListener (Activity activity, OnPausedListener<? super StateT> listener)
Adds a listener that is called when the Task becomes paused.
Parameters
activity | When the supplied Activity
stops, this listener will automatically be removed. |
---|---|
listener |
Returns
- this Task
public abstract ControllableTask<StateT> addOnPausedListener (OnPausedListener<? super StateT> listener)
Adds a listener that is called when the Task becomes paused.
Returns
- this Task
public abstract ControllableTask<StateT> addOnPausedListener (Executor executor, OnPausedListener<? super StateT> listener)
Adds a listener that is called when the Task becomes paused.
Parameters
executor | the executor to use to call the listener |
---|---|
listener |
Returns
- this Task
public abstract boolean isPaused ()
Also: Google
Play services
Returns
- true if the task has been paused.
public abstract boolean pause ()
Also: Google
Play services
Attempts to pause the task. A paused task can later be resumed.
Returns
- true if this task was successfully paused or is in the process of being paused. Returns false if the task is already completed or in a state that cannot be paused.
public abstract boolean resume ()
Also: Google
Play services
Attempts to resume this task.
Returns
- true if the task is successfully resumed or is in the process of being resumed. Returns false if the task is already completed or in a state that cannot be resumed.