Fragment Activity transitions
<p>I have an application which has a TabHost set up with 5 tabs. These tabs are fragment activities. In each of these fragment activities, there is are several fragments set up.</p>

<p>My Main class sets up the tabHost and fragment activities like so</p>

<pre><code>     public class Main extends TabActivity 
        {

            public void onCreate(Bundle savedInstanceState)
            {
                super.onCreate(savedInstanceState);
                requestWindowFeature(Window.FEATURE_NO_TITLE);
                setContentView(R.layout.main);

            Resources res = getResources();
                tabHost = getTabHost();
                TabHost.TabSpec spec;
                Intent intent;

      intent = new Intent().setClass(this,
                                                 Tab1.class);
                    spec = tabHost
                    .newTabSpec("home")
                                            .setIndicator("Home",
                                                    res.getDrawable(R.drawable.tabhome))
                                            .setContent(intent);
                                    tabHost.addTab(spec);
        //and do this for the other 4 tabs

    tabHost.setCurrentTab(0);
}

        }
</code></pre>

<p>Then my fragmentActivities are set up like this</p>

<pre><code>public class Tab1 extends FragmentActivity
{

    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home);

FragmentTransaction fragmentTransaction = getSupportFragmentManager()
                .beginTransaction();
        // Fragments
        Fragment fragOne = new FragmentOne();
        Fragment fragTwo = new FragmentTwo();
        Fragment fragThree = new FragmentThree();

        fragmentTransaction.replace(R.id.fragmentOne, fragOne);
        fragmentTransaction.replace(R.id.fragmentTwo, fragTwo);
        fragmentTransaction.replace(R.id.fragmentThree, fragThree);

        fragmentTransaction.commit();

      }
}
</code></pre>

<p>Tab1 Fragment Activity has 3 fragments as you can see above. Each Fragment, FragmentOne, FragmentTwo and FragmentThree each contain a next button inside the fragments. </p>

<p>What I would like to know is how do I set it up so they transition between each fragment within the class. E.g.</p>

<p>Frag1 (in Frag1 click next button ), Frag 2 transitions from the right (in Frag2 here click next button) Frag3 transitions in from the right (in Frag3, click next button) Frag1 transitions in from the right.</p>

<p>Any assistance would be much appreciated!!!</p>

<p>Edit: Will also paste how the fragments are set up in the home.xml layout file incase your wondering how I set it up.</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/homeMain"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" &gt;

    &lt;RelativeLayout
                    android:id="@+id/FragmentOneRL"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:orientation="vertical" &gt;

                    &lt;FrameLayout
                        android:id="@+id/fragmentOne"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" &gt;
                    &lt;/FrameLayout&gt;
                &lt;/RelativeLayout&gt;

                &lt;RelativeLayout
                    android:id="@+id/FragmentTwoRL"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:layout_below="@+id/FragmentOneRL"
                    android:orientation="vertical" &gt;

                    &lt;FrameLayout
                        android:id="@+id/fragmentTwo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" &gt;
                    &lt;/FrameLayout&gt;
                &lt;/RelativeLayout&gt;

                &lt;RelativeLayout
                    android:id="@+id/FragmentThreeRL"
                    android:layout_width="wrap_content"
                    android:layout_height="100dp"
                    android:layout_below="@+id/FragmentTwoRL"
                    android:orientation="vertical" &gt;

                    &lt;FrameLayout
                        android:id="@+id/fragmentThree"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" &gt;
                    &lt;/FrameLayout&gt;      

                &lt;/RelativeLayout&gt;

       &lt;/RelativeLayout&gt;
</code></pre>
