CancellationSignal

This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack.
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.

public
final
class
CancellationSignal
extends Object

java.lang.Object

↳

android.support.v4.os.CancellationSignal

Static library support version of the framework's CancellationSignal.
Used to write apps that run on platforms prior to Android 4.1. See the framework SDK
documentation for a class overview.

setOnCancelListener

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.

Parameters

listener

CancellationSignal.OnCancelListener: The cancellation listener, or null to remove the current listener.