I’d like to get the height of a linearlayout. I found more information in this answer
View.getWidth()/View.getHeight()won’t give you a meaningful answer until the view has been measured.
How will I know that view has been measured? Is there some event for it?
UPD:
Solution for me is to get layout’s height in overriden onWindowFocusChanged()
There currently aren’t any events that will fire that specifically tell you the size of a view has changed. As suggested in the threads you pointed to, you can check for when the view has focus, and assume that once it has focus, it has width/height greater than 0.
Another way: There’s an onSizeChanged method which you can override in a subclass and use to do something when non-zero values come in. Obviously, be sure to call super.onSizeChanged(…).