I have a situation in my code where I have 2 classes inheriting from different classes, but still need to have more or less the exact same code. I am looking for a way to make their codes the same without having to copy/paste it each time I modify it.
For more information, I work on Android and I have two activity classes inheriting from either android.app.Activity or android.support.v4.app.FragmentActivity. Those class are exactly the same, but the distinction is needed further down in the code when dealing with fragments. As a result I need exactly the same code on 2 different classes since java does not support multiple inheritance. Is there a way to do that in a less cumbersome ?