This method of the Task Class cancels a pending runnable object.
public static boolean cancel(int id);
Returns true if the runnable object was cancelled successfully; returns false if the task was already run or had never been scheduled.
id | An integer that identifies the task. |