In many widgets, one particular ViewGroup should contain all the “content”, while other Views might serve as containers, controllers, navigation elements, or decoration.

For example, for short, scrolling ListView-like widgets, it can be easier to wrap a LinearLayout in a ScrollView, rather than worrying about adapters and header views… This technique allows you to create a ScrollingLinearLayout that automatically adds new Views to the LinearLayout, while the widget itself extends ScrollView.

The proper way to override the add/remove view methods, when using an intermediary ViewGroup, is:

Java ViewGroups route all other addView signatures through the 3 parameter signature used above, so no others need to be overridden.