onFinish

abstract fun onFinish(completedNormally: Boolean)

Implement/override this method to handle cleaning up a Task after successful completion or cancellation.

The task will be in the Finishing state throughout this callback.

If the task finished normally (or stopped with cancel = false, or finished), completedNormally will be true.

If the task was cancelled, completedNormally will be false.

Cancellation in this stage moves the task immediately to the Cancelled state, and execution in the onFinish block will end, even if the task would have otherwise finished normally.

Parameters

completedNormally

true for normal completion of the Task, and false for cancellation.