Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

RunnableScheduler

interface RunnableScheduler
androidx.work.RunnableScheduler

Can be used to schedule Runnables after a delay in milliseconds.
This is used by the in-process scheduler to schedule timed work.

Summary

Public methods
abstract Unit
cancel(@NonNull runnable: Runnable)

Cancels the Runnable which was previously scheduled using scheduleWithDelay(long, Runnable).

abstract Unit
scheduleWithDelay(@IntRange(0) delayInMillis: Long, @NonNull runnable: Runnable)

Schedules a Runnable to run after a delay (in milliseconds).

Public methods

cancel

abstract fun cancel(@NonNull runnable: Runnable): Unit

Cancels the Runnable which was previously scheduled using scheduleWithDelay(long, Runnable).

Parameters
runnable Runnable: The Runnable to be cancelled

scheduleWithDelay

abstract fun scheduleWithDelay(
    @IntRange(0) delayInMillis: Long,
    @NonNull runnable: Runnable
): Unit

Schedules a Runnable to run after a delay (in milliseconds).

Parameters
delayInMillis Long: The delay in milliseconds relative to the current time.
runnable Runnable: The Runnable to be scheduled