Google is committed to advancing racial equity for Black communities. See how.

RunnableScheduler

public 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 void cancel(Runnable runnable)

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

abstract void scheduleWithDelay(long delayInMillis, Runnable runnable)

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

Public methods

cancel

public abstract void cancel (Runnable runnable)

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

Parameters
runnable Runnable: The Runnable to be cancelled

scheduleWithDelay

public abstract void scheduleWithDelay (long delayInMillis, 
                Runnable runnable)

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