CancelableOperation

open class CancelableOperation @JvmOverloads constructor(looper: Looper? = null) : Cancelable, Runnable(source)

A cancelable operation that executes its task on a specific looper.

Constructors

Link copied to clipboard
constructor(looper: Looper? = null)

Properties

Link copied to clipboard

Gets the handler for the operation.

Functions

Link copied to clipboard

Adds a Cancelable that will be called when operation is cancelled. If the operation is already canceled the operation will immediately be canceled.

Link copied to clipboard

Adds a runnable that will be called when operation is finished. If the operation is already finished the runnable will be called immediately.

Link copied to clipboard
open override fun cancel(): Boolean
open override fun cancel(mayInterruptIfRunning: Boolean): Boolean

Cancels the operation.

Link copied to clipboard
open override fun isCancelled(): Boolean

Determines if the operation is canceled.

Link copied to clipboard
open override fun isDone(): Boolean

Determines if the operation is canceled or completed.

Link copied to clipboard
protected open fun onCancel()

Called on the handlers callback when the operation is canceled.

Link copied to clipboard
protected open fun onRun()

Called on the handlers callback when the operation is running.

Link copied to clipboard
open override fun run()