当前位置:网站首页>View. post VS Handler. Differences and usage scenarios of post

View. post VS Handler. Differences and usage scenarios of post

2022-06-25 10:02:00 TowerOs

View.post
When the corresponding Widget View No, attach To window When , Corresponding Runnable Will be submitted to ViewRootImpl#RunQueue , If already attach Words , It will be submitted to UI Thread Corresponding Handler Of MessageQueue Inside

And the corresponding RunQueue A document description :
The run queue is used to enqueue pending work from Views when no Handler is attached. The work is executed during the next call to performTraversals on the thread.

Problem scenario :
When I use View.postDelay To submit a Runnable When , stay Runnable Use of recursion in VIew Submit [email protected] The delay task , When the page is not visible , The corresponding task will not be executed

原网站

版权声明
本文为[TowerOs]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200547374987.html