Created
October 1, 2013 21:47
-
-
Save melihmucuk/6785657 to your computer and use it in GitHub Desktop.
Android AsyncTask Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class asyncTaskOrnek extends AsyncTask<String,String,String> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new asyncTaskOrnek().execute(parametre); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new asyncTaskOrnek(parametre).execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new asyncTaskOrnek().execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected String doInBackground(String... params) { | |
//Bu kısımda herhangi uzun sürecek bir işlem yapılır. | |
// Bu işlem sonucunda mutlaka bir sonuç return edilmelidir. | |
return UzunIslemSonucu; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void onPostExecute(String UzunIslemSonucu){ | |
ornekText.setText(UzunIslemSonucu); | |
dialog.dismiss(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onPreExecute() { | |
dialog.setMessage("Yükleniyor..."); | |
dialog.show(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ProgressDialog dialog = new ProgressDialog(Anasayfa.this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment