HandlerContext

class HandlerContext : CoroutineDispatcher, Delay

Implements CoroutineDispatcher on top of an arbitrary Android Handler.

Parameters

handler - a handler.

name - an optional name for debugging.

Constructors

<init>

HandlerContext(handler: Handler, name: String? = null)

Implements CoroutineDispatcher on top of an arbitrary Android Handler.

Functions

awaitFrame

suspend fun awaitFrame(): Long

Awaits the next animation frame and returns frame time in nanoseconds.

dispatch

fun dispatch(
    context: CoroutineContext,
    block: Runnable
): Unit

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

invokeOnTimeout

fun invokeOnTimeout(
    time: Long,
    unit: TimeUnit,
    block: Runnable
): DisposableHandle

scheduleResumeAfterDelay

fun scheduleResumeAfterDelay(
    time: Long,
    unit: TimeUnit,
    continuation: CancellableContinuation<Unit>
): Unit

toString

fun toString(): String