RunnableScheduler
interface RunnableScheduler
androidx.work.RunnableScheduler |
Can be used to schedule Runnable
s after a delay in milliseconds.
This is used by the in-process scheduler to schedule timed work.
Summary
Public methods | |
---|---|
abstract Unit |
Cancels the |
abstract Unit |
scheduleWithDelay(@IntRange(0) delayInMillis: Long, @NonNull runnable: Runnable) Schedules a |
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 |