when is onSizeChanged() called?
Is onSizeChanged()
called once the user touches some part of the screen?
I'm confused about the order in which onDraw()
, onMeasure()
and onSizeChanged()
are called.
Android doesn't know the real size at start, it needs to calculate it. Once it's done, onSizeChanged()
will notify you with the real size.
onSizeChanged()
is called once the size as been calculated. Events don't have to come from users all the time. In this example when android change the size, onSizeChanged()
is called. Same thing with onDraw()
, when the view should be drawn onDraw()
is called.
onMeasure()
is called automatically right after a call to measure()