Inheritance question / problem

Posted by Itsik on Stack Overflow See other posts from Stack Overflow or by Itsik
Published on 2010-06-05T18:04:32Z Indexed on 2010/06/05 18:12 UTC
Read the original article Hit count: 158

Filed under:
|
|
|

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 DRY and implement my methods once.

© Stack Overflow or respective owner

Related posts about java

Related posts about android