The schedule method of the Task Class contains the following signatures:
schedule(Runnable runnable)
schedule(Runnable runnable, long when)
schedule(Runnable runnable, long when boolean lightweight)
Schedules a runnable object to run immediately in the global task manager as a lightweight task.
public static int schedule(Runnable runnable);
Returns a non-zero integer that identifies the task.
runnable | The object scheduled to run. |
Schedules a runnable object to run in the global task manager at the specified time as a lightweight task.
public static int schedule(Runnable runnable, long when);
Returns a non-zero integer that identifies the task.
runnable | The object that is run. |
when | The time at which the object is run. |
Schedules a runnable object to run in the global task manager at the specified time, and optionally as a lightweight task or not.
Public static int schedule(Runnable runnable, long when, boolean lightweight);
Returns a non-zero integer that identifies the task.
runnable | The object that runs. |
when | The time at which the object runs. |
lightweight | Set to true to run the task as a lightweight task; false, otherwise. |