开发者

Any problem in drawing with Canvas outside UIthread in Android?

I have a somewhat intensive drawing task that I want to move to a separate worker thread outside of UI thread. I would not update UI in this thread, only draw bitmaps and text in my own Canvas object and then post that object afterwards开发者_运维技巧 to an ImageView, using runOnUiThread.

Is there any drawback or side effect on doing it this way?


Well I would consider this akin to having to load images from files for situations such as twitter and contact lists. Post a stand in to the UI, process the images asynchronously, then refresh the view with the new image.

The Twitter app should be able to be used for inspiration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜