| Constructor and Description |
|---|
BackgroundTask(ThreadHelper threadHelper)
Construct BackgroundTask object
|
| Modifier and Type | Method and Description |
|---|---|
Boolean |
call()
Start task on background thread
|
abstract boolean |
doInBackground()
Override this method to perform a computation on a background thread.
|
ExecutionException |
getExecutionException()
Returns Exception thrown when the worker task fails due to a uncaught RuntimeException
|
void |
onCancelled(Boolean result)
Runs on separate thread after
TaskRunner.cancel(boolean) is invoked. |
void |
onPostExecute(Boolean result)
Runs on the UI thread after
doInBackground(). |
void |
onPreExecute()
Runs on the UI thread before
doInBackground(). |
void |
setExecutionException(ExecutionException executionException)
Set Exception thrown when the worker task fails due to a uncaught RuntimeException
|
public BackgroundTask(ThreadHelper threadHelper)
threadHelper - ThreadHelper allows thread priority adjustmentpublic abstract boolean doInBackground()
onPreExecute(),
onPostExecute(Boolean)public void onPreExecute()
doInBackground().onPostExecute(Boolean),
doInBackground()public void onPostExecute(Boolean result)
doInBackground(). The
specified result is the value returned by doInBackground()
or null if the task was cancelled or an exception occured.result - The result of the operation computed by doInBackground().onPreExecute(),
doInBackground()public void onCancelled(Boolean result)
TaskRunner.cancel(boolean) is invoked.result - The result of the operation computed by doInBackground().TaskRunner.cancel(boolean),
TaskRunner.isCancelled()public Boolean call() throws Exception
call in interface Callable<Boolean>ExceptionCallable.call()public void setExecutionException(ExecutionException executionException)
executionException - ExecutionExceptionpublic ExecutionException getExecutionException()
This documentation is licensed by Andrew Bowley under the GPLv3 License.