code: public void cancel() {
          if (task != null && !task.isCancelled()
                  && task.getStatus() != AsyncTask.Status.FINISHED) {
              task.cancel(true);
          }
      }
docs: Cancel the task