Example #1
0
 public boolean isRunning() {
   if (mTaskHandler != null) {
     return mTaskHandler.getStatus() == AsyncTask.Status.RUNNING
         || mTaskHandler.getStatus() == AsyncTask.Status.PENDING;
   }
   return false;
 }
Example #2
0
 public void breakHttpTask() {
   if (mTaskHandler != null && isRunning()) {
     mTaskHandler.cancel(true);
   }
   mTaskHandler = null;
 }