Delayed task

This task is used for delaying actions being sent to the server.

Creating the task

To create a new delayed task, simply instantiate the DelayedTask class and override the run() method:

new DelayedTask(DELAY) {
    @Override
    public void run() {
        //RUN SOMETHING
    }
};

You can also cancel a task before it is executed:

task.cancel();

Additionally, you can get the task id by doing the following:

int id = task.getId();

Last updated

Was this helpful?