I have this structure:
Class1
Class2 extends Class1
I have a pile of utility classes on the side that take a Class2 to do all kinds of work.
The problem: I need to create a Class3 extending Class2 to use those classes. Class3 will have a Google API's Android MapView. MapViews can ONLY be created FROM A CLASS EXTENDING MapActivity. I would need
Class3 extends Class2 AND MapActivity.
which can't be done.
Changing my class3 to only extend MapActivity would require me to modify a hoard of code inherited (no pun intended) from previous developers.
Changing my class3 to only extend Class2 breaks because the map requires a MapActivity.
What would be the best approach?
EDIT: Several people mentioned the 'interface solution'. Sounds like the right solution. I forgot to mention, though, that Class2 is an abstract class, and it will be a pain to move the implemented methods around. A lot of code repetition... DRY goes wet on this one... :)