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