I wanted to know if View.post(Runnable r)
runnable's run()
method is executed after View
is drawn or after View
(in case it is a ViewGroup
) and all it's children are drawn?
Asked
Active
Viewed 2,342 times
3

Heisenberg
- 3,153
- 3
- 27
- 55
1 Answers
1
It will be put into UI message queue, and it depends on internal Android workings when exactly will be executed. If rendering of child views is in one message then it might execute after rendering, if it is split by android into several messages then your message might possibly be executed in between of rendering.
If you want to make sure it will be executed after child redraw, maybe use View.postDelayed with some small delay?
What event is fired after all views are fully drawn?
here is explanation from Romain Guy that it is actuall executed after redraw - if nothing changed (its 4 year old SO), then you might trust this answer.