Overridden View Method onSizeChanged
DoodleView’s size is not determined until it’s inflated and added to the
View hierarchy; therefore, we can’t determine the size of the drawing
onCreate. So, we override
onSizeChanged (Fig. 7.23), which is called when the
DoodleView’s size changes—e.g., when it’s added to an
View hierarchy or when the user rotates the device. In this app,
onSizeChanged is called only when the
DoodleView is added to the
View hierarchy, because the app always displays in portrait on phones and small tablets, and in landscape on large tablets.
64 // Method onSizeChanged creates Bitmap and Canvas after app displays65 @Override ...