Update UI from an AsyncTaskLoader

后端 未结 5 1860
庸人自扰
庸人自扰 2021-02-10 01:21

I\'ve converted my AsyncTask to an AsyncTaskLoader (mostly to deal with configuration changes). I have a TextView I am using as a progres

5条回答
  •  野的像风
    2021-02-10 02:00

    It's actually possible. You essentially need to subclass the AsyncTaskloader and implement a publishMessage() method, which will use a Handler to deliver the progress message to any class that implements the ProgressListener (or whatever you want to call it) interface.

    Download this for an example: http://www.2shared.com/file/VW68yhZ1/SampleTaskProgressDialogFragme.html (message me if it goes offline) - this was based of http://habrahabr.ru/post/131560/

提交回复
热议问题