0

I want to get the tab content i.e. framelayout's height and width in the first tab's activity. But it always returns 0. I know that we cannot call getHeight() or getMeasuredHeight() in onCreate() because the view isnt drawn yet, but then when to call it ? In activity I dont have access to onDraw or onMeasure method, so how and when can I access the height and width ?

Prabhat
  • 2,261
  • 7
  • 46
  • 74
  • This http://stackoverflow.com/questions/3581753/cant-figure-out-how-to-get-view-layout-width-height solved my problem. However, I would like to know when the onGlobalLayout() is actually called ? – Prabhat Apr 30 '11 at 14:09

1 Answers1

1

http://developer.android.com/reference/android/view/ViewTreeObserver.OnGlobalLayoutListener.html You can refer to this ....

Note : The onGlobalLayout() will be called if there is

  1. Any changes in the view like change in Screen Orientation
  2. Any changes in layout while scrolling or while hiding some widgets, this method will be called
stema
  • 90,351
  • 20
  • 107
  • 135
KK_07k11A0585
  • 2,381
  • 3
  • 26
  • 33