I'm creating a custom Layout for android. The layout implementation is exactly the same, but once I need to extend from RelativeLayout, and once from LinearLayout.
class Layout1 extends LinearLayout {
// methods and fields
}
class Layout2 extends RelativeLayout {
// the same EXACT methods and fields
}
How can I use inheritance to avoid code duplication and implement my methods once.