check AsyncTask - Android android.os

Android examples for android.os:AsyncTask

Description

check AsyncTask

Demo Code

import android.os.AsyncTask;

public class Main {

  public static boolean checkTask(AsyncTask<?, ?, ?> paramAsyncTask) {
    boolean exist = false;
    if (paramAsyncTask != null) {
      AsyncTask.Status taskstatus = paramAsyncTask.getStatus();
      AsyncTask.Status finished = AsyncTask.Status.FINISHED;

      if ((taskstatus == finished) || paramAsyncTask.cancel(true) || paramAsyncTask.isCancelled()) {
        exist = false;// w  w w  .jav a2s  .c  o m
      } else {
        exist = true;
      }
    }
    return exist;
  }

}

Related Tutorials