I guess this is what you need to look at: use onSizeChanged()
of your view. Here is an EXTENDED code snippet on how to use onSizeChanged()
to get your layout's or view's height and width dynamically http://syedrakibalhasan.blogspot.com/2011/02/how-to-get-width-and-height-dimensions.html