Handler vs Thread

后端 未结 2 779
悲哀的现实
悲哀的现实 2021-02-08 02:39

I would like to know, once for all. I\'ve read in many places. When I want do some \'long time operations\' I should use a Handler.

But I don\'t get why? A

2条回答
  •  一整个雨季
    2021-02-08 03:02

    A Handler lets you communicate back with the UI thread from your background thread. This is because UI operations are forbidden from within background threads. Note that starting at version 1.5, the AsyncTask class makes it much easier to do so.

提交回复
热议问题