Skip to content

Instantly share code, notes, and snippets.

@furkanaskin
Created September 13, 2019 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furkanaskin/204527c4927e8ea87c84c93109dea8c2 to your computer and use it in GitHub Desktop.
Save furkanaskin/204527c4927e8ea87c84c93109dea8c2 to your computer and use it in GitHub Desktop.
private class MyAsyncTask extends AsyncTask<String, Void, int> {
protected void onPreExecute() {
// Ön hazırlık - UI threadinde çalışır.
}
protected int doInBackground(Void… param) {
// Network çağrısını burada yap.
}
protected void onProgressUpdate(String… values) {
// Task devam ederken burada progress göstermek gibi işlemler yapılabilir - UI threadinde çalışır.
}
protected void onPostExecute(int result) {
// UI'i güncelle.
}
}
new MyAsyncTask().execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment