public static FutureTask doInBackground ( final OnBackgroundJob onBackgroundJob , ExecutorService executor ) { FutureTask task = ( FutureTask ) executor . submit ( new Runnable ( ) { @ Override public void run ( ) { onBackgroundJob . doOnBackground ( ) ; } } ) ; return task ; }
Executes the provided code immediately on a background thread that will be submitted to the provided ExecutorService