TabHost with fragments and TabActivity inside one of fragment
===

i have a FragmentActivity with tabhost :

    public class MainActivity extends FragmentActivity {
        public static final String LOG_TAG = "MainActivity";
    
        private TabHost mTabHost;
        private TabManager mTabManager;
        private View tabIndicator;
        private API mApi;
    
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            overridePendingTransition(R.anim.anim_right_to_center, R.anim.anim_hold);
            setContentView(R.layout.main_activity);
    
            mApi = (API) getIntent().getSerializableExtra(LOG_TAG);
            Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    mApi.getFriendsInDetails(mApi.getFriendsUIDList());
                }
            });
            t.start();
    
    
    
    
    
            initialViews();
    
            mTabHost = (TabHost)findViewById(android.R.id.tabhost);
            mTabHost.setup();
       
            mTabManager = new TabManager(this, mTabHost, R.id.realtabcontent);
    
            mTabManager.addTab(mTabHost.newTabSpec("message").
                    setIndicator(getResources().getString(R.string.messages), getResources().getDrawable(R.drawable.message_tab_selector)),
                    MessagesTabActivity.class, null);
            mTabManager.addTab(mTabHost.newTabSpec("contacts").
                    setIndicator(getResources().getString(R.string.contacts), getResources().getDrawable(R.drawable.contacts_tab_selector)),
                    ContactsFragment.class, null);
            mTabManager.addTab(mTabHost.newTabSpec("search").
                    setIndicator(getResources().getString(R.string.search), getResources().getDrawable(R.drawable.search_tab_selector)),
                    SearchTabActivity.class, null);
            mTabManager.addTab(mTabHost.newTabSpec("settings").
                    setIndicator(getResources().getString(R.string.settings), getResources().getDrawable(R.drawable.settings_tab_selector)),
                    SettingsTabActivtiy.class, null);
    
            if (savedInstanceState != null) {
                mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
            }
    
        }
    
        private void initialViews() {
            mTabHost = (TabHost)findViewById(android.R.id.tabhost);
            mTabHost.setup();
        }
    
        public static class TabManager implements TabHost.OnTabChangeListener {
            private final FragmentActivity mActivity;
            private final TabHost mTabHost;
            private final int mContainerId;
            private final HashMap<String, TabInfo> mTabs = new HashMap<String, TabInfo>();
            TabInfo mLastTab;
    
            static final class TabInfo {
                private final String tag;
                private final Class<?> clss;
                private final Bundle args;
                private Fragment fragment;
    
                TabInfo(String _tag, Class<?> _class, Bundle _args) {
                    tag = _tag;
                    clss = _class;
                    args = _args;
                }
            }
    
            static class DummyTabFactory implements TabHost.TabContentFactory {
                private final Context mContext;
    
                public DummyTabFactory(Context context) {
                    mContext = context;
                }
    
                @Override
                public View createTabContent(String tag) {
                    View v = new View(mContext);
                    v.setMinimumWidth(0);
                    v.setMinimumHeight(0);
                    return v;
                }
            }
    
            public TabManager(FragmentActivity activity, TabHost tabHost, int containerId) {
                mActivity = activity;
                mTabHost = tabHost;
                mContainerId = containerId;
                mTabHost.setOnTabChangedListener(this);
            }
    
            public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
                tabSpec.setContent(new DummyTabFactory(mActivity));
                String tag = tabSpec.getTag();
    
                TabInfo info = new TabInfo(tag, clss, args);
    
                // Check to see if we already have a fragment for this tab, probably
                // from a previously saved state.  If so, deactivate it, because our
                // initial state is that a tab isn't shown.
                info.fragment = mActivity.getSupportFragmentManager().findFragmentByTag(tag);
                if (info.fragment != null && !info.fragment.isDetached()) {
                    FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
                    ft.detach(info.fragment);
                    ft.commit();
                }
    
                mTabs.put(tag, info);
                mTabHost.addTab(tabSpec);
            }
    
            @Override
            public void onTabChanged(String tabId) {
                TabInfo newTab = mTabs.get(tabId);
                if (mLastTab != newTab) {
                    FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();
                    if (mLastTab != null) {
                        if (mLastTab.fragment != null) {
                            ft.detach(mLastTab.fragment);
                        }
                    }
                    if (newTab != null) {
                        if (newTab.fragment == null) {
                            newTab.fragment = Fragment.instantiate(mActivity,
                                    newTab.clss.getName(), newTab.args);
                            ft.add(mContainerId, newTab.fragment, newTab.tag);
                        } else {
                            ft.attach(newTab.fragment);
                        }
                    }
    
                    mLastTab = newTab;
                    ft.commit();
                    mActivity.getSupportFragmentManager().executePendingTransactions();
                }
            }
        }
    }

and i have TabActivity inside fragment: 

    (mTabManager.addTab(mTabHost.newTabSpec("contacts").
                    setIndicator(getResources().getString(R.string.contacts), getResources().getDrawable(R.drawable.contacts_tab_selector)),
                    ContactsFragment.class, null);)

**ContactsFragment.java :**

    public class ContactsFragment extends Fragment {
         @Override
         public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
             if (container == null){
                 return null;
             }
    
             View tabsFragment = inflater.inflate(R.layout.contacts_fragment_tab, container);
             TabHost mTabHost = (TabHost)tabsFragment.findViewById(android.R.id.tabhost);
             LocalActivityManager mLocalActivity = new LocalActivityManager(getActivity(), false);
             mLocalActivity.dispatchCreate(savedInstanceState);
             mTabHost.setup(mLocalActivity);
             addTabs(mTabHost, "tag1", getResources().getText(R.string.contacts).toString(), ContactsTabActivtiy.class);
             addTabs(mTabHost, "tag2", getResources().getText(R.string.contacts).toString(), ContactsTabActivtiySecond.class);
             return tabsFragment;
         }
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
        }
    
        public void addTabs(TabHost tabHost, String tag, String text, Class<?> clss){
            TabHost.TabSpec tabspec = tabHost.newTabSpec(tag);
            tabspec.setIndicator(text);
            tabspec.setContent(new Intent(getActivity().getApplicationContext(), clss));
            tabHost.addTab(tabspec);
        }
    }

In application when i clicked on the tab with TabActivity i have following error:

    The specified child already has a parent. You must call removeView() on the child's parent first. In the row 

mActivity.getSupportFragmentManager().executePendingTransactions();
in MainActivity.java

Do you have any suggestion for my issue?
I need make something like this - http://cs5157.userapi.com/u06492/docs/c51031e0bd3b/Contacts_Friends.png