读书人

扩张AysncTask

发布时间: 2012-09-09 09:27:54 作者: rapoo

扩展AysncTask

本文来自http://sirinsevinc.wordpress.com/2010/05/11/118/

Creating a progressDialog in the constructor and displaying it immediately and dismissing it in onPostExecute method. Unfortunately this didnt work because UI thread was blocked by the ProgessDialog, it was tied to it and that’s why it wasn’t possible to dismiss the dialog. Finally I came up with another idea. First I created another class “ProgressTimedTask” which extends AsyncTask. It has a progressDialog as a member field. The source code looks like this.

读书人网 >移动开发

热点推荐