MainThreadCallbackExecutor

class MainThreadCallbackExecutor : CallbackExecutor

CallbackExecutor bound to the main thread of the application.

Important: This is a Public Preview API. It may be changed or removed at any time.

Constructors

Link copied to clipboard
fun MainThreadCallbackExecutor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun cancel(runnable: Runnable)

Cancels the given runnable if it is still pending.

Link copied to clipboard
open override fun post(runnable: Runnable)

Posts the given runnable on the main thread.

Link copied to clipboard
open override fun postDelayed(runnable: Runnable, delay: Duration)

Posts the given runnable using the executor's Thread with a given delay.

Link copied to clipboard
fun runOrPost(runnable: Runnable)

If current thread is isMainThread then executes provided runnable otherwise post it.