Java tutorial
//package com.java2s; import android.os.AsyncTask; public class Main { static boolean killAsync(AsyncTask asyncTask) { return asyncTask != null && !asyncTask.isCancelled() && asyncTask.cancel(true); } }