Is there any way to insert a custom class in an existing inheritance tree?
<p>I’m working on an android application that currently has two Activities, A and B, that have some code in common, their options menu and some other code.  To cut down on copying and pasting, I created a class called BaseActivity that extends Activity with the, and I then had A and B extend BaseActivity.  At least that’s what I wanted to do, but I ran into a problem.  While A now extends BaseActivity just fine, I can't figure out how to make B extend BaseActivity because it's not just an activity, it’s a MapActivity.  So it’s inheritance tree looks like this:</p>

<p>MapActivity inheritance tree:</p>

<pre><code>java.lang.Object
   android.content.Context
       android.content.ContextWrapper
           android.view.ContextThemeWrapper
               android.app.Activity
                   com.google.android.maps.MapActivity
</code></pre>

<p>But in order for it to inherit my code, I’d need to make it look like this:</p>

<pre><code>java.lang.Object
   android.content.Context
       android.content.ContextWrapper
           android.view.ContextThemeWrapper
               android.app.Activity
                  mypackage.BaseActivity
                     com.google.android.maps.MapActivity
</code></pre>

<p>Is there any way to insert my custom class in an inheritance tree?</p>
