Java tutorial
//package com.java2s; //License from project: Apache License import android.os.AsyncTask; public class Main { /** Returns whether the task specified as an argument is running or not. * @param theTask {@link AsyncTask} to be checked. * @return True if the task is running, false otherwise. */ public static boolean isRunning(final AsyncTask<?, ?, ?> theTask) { return (theTask != null && theTask.getStatus().equals(AsyncTask.Status.RUNNING)); } }