Checks whether AsyncTask is not null and if it is running. - Android android.os

Android examples for android.os:AsyncTask

Description

Checks whether AsyncTask is not null and if it is running.

Demo Code


//package com.java2s;
import android.os.AsyncTask;

public class Main {
    /**/* w  w w  .j av a  2  s .  c  o  m*/
     * 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;
    }
}

Related Tutorials