I have a main activity whose layout is from a typical XML Relative
Layout.  One of the items in that layout is TextView whose textSize is
15sp.  I want to capture the actual size of this TextView after the
layout is inflated for use elsewhere in my app.  So I tried calling
the view.getHeight() method as late as possible in my activity startup
so as to capture it after the inflation process.  But I find through
debugging that getHeight() returns 0 when called from anywhere in my
activitiy's onCreate() or onResume() method.  And I don't know of
anything that is always called after onResume().  However, if I call
getHeight() much later, say as part of an onClick handler in my
activity, then getHeight() returns a more reasonable 21.  Apparently
the height of my TextView (which is part of my main activity layout)
is not yet computed until later than I have been calling.  When can I
call getHeight() and get a reasonable answer?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to