Java tutorial
//package com.java2s; import android.os.AsyncTask; public class Main { /** * Checks whether task is not null and if it is running. */ public static boolean isRunning(AsyncTask<?, ?, ?> task) { return task != null && task.getStatus() == AsyncTask.Status.RUNNING; } }