JDP 發表於 2013-9-16 17:52:29

AsyncTask (異步任務)

似乎Android 3.0以後,呼叫Web Service都會出現android.os.NetworkOnMainThreadException,必需使用asynctask來解決。

Android web service access using Async Task
http://codeoncloud.blogspot.tw/2013/07/android-web-service-access-using-async.html (已測試,確定可用)

To find more details about Async Task follow the links below
http://developer.android.com/reference/android/os/AsyncTask.html
http://www.vogella.com/articles/AndroidBackgroundProcessing/article.html

其他參考網址:
http://imax-live.blogspot.tw/2013/03/asynctask.html
http://lionlionchopper.pixnet.net/blog/post/60361723-handler%E5%92%8Casynctask
http://stackoverflow.com/questions/18297485/android-os-networkonmainthreadexception-sending-an-email-from-android/18297516#18297516
頁: [1]
查看完整版本: AsyncTask (異步任務)