Skip to content

Instantly share code, notes, and snippets.

@gogo40
Last active September 23, 2015 18:45
Show Gist options
  • Save gogo40/b4d8809fcf7c113c1858 to your computer and use it in GitHub Desktop.
Save gogo40/b4d8809fcf7c113c1858 to your computer and use it in GitHub Desktop.
AsyncTask<ResultType> task = new AsyncTask<>();
task
.setTask(new Task() {
void run() {
doSomething();
}
})
.setResultListener(new ResultListener<ResultType>() {
void onResult(ResultType v) {
processResult(v);
}
})
.setErrorListener(new ErrorListener<Exception>() {
void onException(Exception e) {
processException(e);
}
});
task.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment