Code example for FutureTask

Methods: cancel

        return mCancelled.get();
    public final boolean cancel(boolean mayInterruptIfRunning) {
        return mFuture.cancel(mayInterruptIfRunning);
    public final Result get() throws InterruptedException, ExecutionException { 
        return mFuture.get();
    public final Result get(long timeout, TimeUnit unit)
            throws InterruptedException, ExecutionException, TimeoutException { 
        return mFuture.get(timeout, unit);
    public final LifoAsyncTask<Params, Progress, Result> execute( 
            Params... params) {
        return executeOnExecutor(sDefaultExecutor, params);
Connect your IDE to all the code out there  Get Codota for Java