Skip to content

Instantly share code, notes, and snippets.

@julianfalcionelli
Last active May 15, 2017 00:31
Show Gist options
  • Save julianfalcionelli/1660750db92ce18d543d274ea5ed5dd5 to your computer and use it in GitHub Desktop.
Save julianfalcionelli/1660750db92ce18d543d274ea5ed5dd5 to your computer and use it in GitHub Desktop.
AsyncTask
//...
new AsyncTask<Void, Void, String>() {
@Override
protected void onPreExecute() {
//...
}
@Override
protected String doInBackground(Void... voids) {
return performBlockingTask();
}
@Override
protected void onProgressUpdate(Integer... progress) {
mProgessBar.setProgress(progress);
}
@Override
protected void onPostExecute(String result) {
mTextView.setText(result);
}
}.execute();
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment