Code example for FutureTask

Methods: cancel

     * @see #isCancelled() 
     * @see #onCancelled() 
    public final boolean cancel(boolean mayInterruptIfRunning) {
        return mFuture.cancel(mayInterruptIfRunning);
     * Waits if necessary for the computation to complete, and then 
     * retrieves its result. 
     * @return The computed result. 
     * @throws CancellationException If the computation was cancelled. 
     * @throws ExecutionException If the computation threw an exception. 
     * @throws InterruptedException If the current thread was interrupted 
     *         while waiting. 
    public final Result get() throws InterruptedException, ExecutionException { 
Connect your IDE to all the code out there  Get Codota for Java