Thanks, Adam. It seems that onSizeChanged is the way to go. I can cache the 
last width passed in onSizeChanged and only trigger new work if the width 
changes. I'm glad you pointed out that onSizeChanged can be called with 0 
width; I wouldn't want to do any work in response to that!

Just to be clear, though, when I mentioned doing something in onDraw, it was 
the following: retrieve the current width; check that the height 
calculations were valid for that width; if so, proceed with normal 
rendering; if not, then fire up a background thread to update the height and 
skip rendering. I was never thinking about doing the height calculation in 
onDraw itself. (I gather that both you and Blake had that impression.) Your 
point about the frequency with which onDraw may be called suggests, however, 
that if I can keep this test out of onDraw it might be better.

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

Reply via email to