Add FragmentActivity in TabHost

actually I have a FragmentActivity with a Tabhost, some Fragment inside and you can slide between the different Fragment thanks to a ViewPager. With this FragmentActivity, I would like to incorporate it into a other Tabhost, and so have the one below the other.

For the moment, I have this solution :

public class TabsViewPagerFragmentActivity extends ActivityGroup {

protected void onCreate(Bundle savedInstanceState) {
    // Inflate the layout

    TabHost mTabHost = (TabHost)findViewById(;

    TabSpec ts = mTabHost.newTabSpec("tab_test1").setIndicator("TAB1");
    ts.setContent(new Intent(this,PageGaucheFragment.class)); <--- PageGaucheFragment is the FragmentAtivity with the ViewPager that I would like to add into the TabHost




It works, but ActivityGroup was deprecated :( And I don't find any other solution to solve this problem.How can I have 2 TabHost and that the second can slide between the different Fragment ? Thanks for your answer, and sorry for my English ;)


Look here:

I've used it successfully.

Need Your Help

Tutorials for ASP.NET MVC3 with IoC ,Repository patterns etc dependency-injection repository-pattern autofac

I will start new project which is based on ASP.NET MVC 3 using C# and razor engine.

Adding user and password to Sql Server database


My connection string defined in Web.Config currently indicatea no user or password is needed: