public boolean run(){
  try {
    if (mExecutor.isShutdown() || mExecutor.isTerminated()) {
      Log.e(TAG,"Tasker:run - Executor is shutdown");
      mExecutor=Executors.newSingleThreadExecutor();
    }
    for (    Task task : tasks) {
      final ThreadRunnable threadRunnable=new ThreadRunnable(task);
      final Future future=mExecutor.submit(threadRunnable);
      runableMap.put(threadRunnable,future);
    }
    tasks.clear();
  }
 catch (  Exception RejectedExecutionException) {
    Log.e(TAG,"Tasker:run - RejectedExecutionException",RejectedExecutionException);
    return false;
  }
  return true;
}

public boolean run ( ) { try { if ( mExecutor . isShutdown ( ) || mExecutor . isTerminated ( ) ) { Log . e ( TAG , "Tasker:run - Executor is shutdown" ) ; mExecutor = Executors . newSingleThreadExecutor ( ) ; } for ( Task task : tasks ) { final ThreadRunnable threadRunnable = new ThreadRunnable ( task ) ; final Future future = mExecutor . submit ( threadRunnable ) ; runableMap . put ( threadRunnable , future ) ; } tasks . clear ( ) ; } catch ( Exception RejectedExecutionException ) { Log . e ( TAG , "Tasker:run - RejectedExecutionException" , RejectedExecutionException ) ; return false ; } return true ; }
start running all tasks
