As obvious as it is, I went to the Android Developer's website to look up the available methods for finding width and height. And it said android.view.View.getWidth() and android.view.View.getHeight() will do just the thing. But..... it did NOT do the thing that way.
I had been looking around all over the forums and sites to find the solution.... LOTs of people are asking this questions, but i couldn't find that absolute solution from any of the forums. So, once I figured out the way, I thought of putting the solution up on my blog.
At first, here is how the android activity looks:
![]() |
| Activity with a Toast Message showing width and height of the green frame |


You made my day! Thanks alot!
ReplyDeleteCheers mate, but Christ! I want to love Android development but it's SO painful, a simple thing like measuring the size of a View requires a custom class!?
ReplyDeletetotally agree with you on that one........ stupid stuff.
ReplyDeletethank you man.....i was trying this since 2 days....
ReplyDeleteThanx a lot. You made my day.
ReplyDeleteonSizeChanged() solution works in my case to get Height and width of a custom view.