java.lang.Object | |
↳ | android.os.CancellationSignal |
Provides the ability to cancel an operation in progress.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
CancellationSignal.OnCancelListener | Listens for cancellation. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Creates a cancellation signal, initially not canceled.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Cancels the operation and signals the cancellation listener.
|
||||||||||
|
Returns true if the operation has been canceled.
|
||||||||||
|
Sets the cancellation listener to be called when canceled.
|
||||||||||
|
Throws
OperationCanceledException
if the operation has been canceled.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a cancellation signal, initially not canceled.
Cancels the operation and signals the cancellation listener. If the operation has not yet started, then it will be canceled as soon as it does.
Returns true if the operation has been canceled.
Sets the cancellation listener to be called when canceled.
This method is intended to be used by the recipient of a cancellation signal
such as a database or a content provider to handle cancellation requests
while performing a long-running operation. This method is not intended to be
used by applications themselves.
If
cancel()
has already been called, then the provided
listener is invoked immediately.
This method is guaranteed that the listener will not be called after it
has been removed.
listener | The cancellation listener, or null to remove the current listener. |
---|
Throws
OperationCanceledException
if the operation has been canceled.
OperationCanceledException | if the operation has been canceled. |
---|