Fork me on GitHub

6/10/2011

[Android] AsyncTask - a file downloading example with progress bar



Android single-threaded model:
1. Do not block the UI thread, and
2. Make sure that you access the Android UI toolkit only on the UI thread.

AsyncTask just makes it easier to do both of these things.

This example implement a AsyncTask downloader with a progress bar, Enjoy it :)
Download source

參考資料:

Painless Threading | Android Developers
http://developer.android.com/resources/articles/painless-threading.html

How to Use AsyncTask for Android
http://www.brighthub.com/mobile/google-android/articles/82805.aspx

AsyncTask | Android Developers
http://developer.android.com/reference/android/os/AsyncTask.html

... ...

No comments:

Post a Comment