Skip to main content

DevBytes: Request During Layout

Horrible things can result from calling requestLayout() during a layout pass. DON'T DO THIS.



The demo that I wrote to show why this is bad seems very contrived, but I have since run across application code that did nearly the exact same thing, explicitly calling requestLayout() during onLayout(). Ugh. Typically, the cases where this problem occurs are a tad more subtle than that.



YouTube: https://www.youtube.com/watch?v=HbAeTGoKG6k



Code: http://developer.android.com/shareables/devbytes/RequestDuringLayout.zip





Comments

Popular posts from this blog

2023 Josef Newgarden

Een paar weken geleden won Josef Newgarden de Indianapolis 500. GreenLight Models gaat dit model produceren in de schaal 1/18. Plaats hier je pre-order. Kijkerstip! Samen met Scott McLaughlin, zijn Penske teamgenoot heeft Josef Newgarden een zeer komsiche youtube serie met flauwe grappen genaamd Bus Bros!