title: How to upgrade my Activities to Fragments  and avoid ClassCastException?
body: <p>I have quite a large hierarchy of classes that are Activities. I just installed the v4 compatibility package. What is the easiest way to get all my Activities in a way that I can use them in a Fragment with a TabHost inside of it?</p>
  
  <p>Line of code: </p>
  
  <pre><code>    mTabsAdapter.addTab(mTabHost.newTabSpec("feed").setIndicator("Feed"), FActivity.class, null);
  </code></pre>
  
  <p>Line 165:</p>
  
  <pre><code>@Override
      public Fragment getItem(int position) {
                  TabInfo info = mTabs.get(position);
                  return Fragment.instantiate(mContext, info.clss.getName(), info.args);
              }
  </code></pre>
  
  <p>Specifically I want to avoid errors like: </p>
  
  <pre><code>07-19 01:33:24.940: ERROR/AndroidRuntime(17581): java.lang.ClassCastException: com.c.FActivity
  07-19 01:33:24.940: ERROR/AndroidRuntime(17581):     at android.support.v4.app.Fragment.instantiate(Fragment.java:378)
  07-19 01:33:24.940: ERROR/AndroidRuntime(17581):     at com.c.Main$TabsAdapter.getItem(Main.java:165)
  07-19 01:33:24.940: ERROR/AndroidRuntime(17581):     at android.support.v4.app.FragmentPagerAdapter.instantiateItem(FragmentPagerAdapter.java:62)
  </code></pre>