How can I start a fragmentactivity?
<p>For my app I use the ViewPager lib, so users can swipe pages. I would like to use fragmentactivity's or activity's, so I can access the layout elements by FindViewById. But when I try to start my app I get a error:</p>

<pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.ViewPagerActivity}: 

Caused by: java.lang.ClassCastException: com.example.testActivity
</code></pre>

<p>I cant cast to a fragment... So whats the solution to get this right? </p>

<p>Main:</p>

<pre><code>/**
 * The &lt;code&gt;ViewPagerFragmentActivity&lt;/code&gt; class is the fragment activity hosting the ViewPager
 */
public class ViewPagerActivity extends FragmentActivity{
    /** maintains the pager adapter*/
    private PagerAdapter mPagerAdapter;
    /* (non-Javadoc)
     * @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.main);
        //initialsie the pager
        this.initialisePaging();
    }

    /**
     * Initialise the fragments to be paged
     */
    private void initialisePaging() {

        List&lt;Fragment&gt; fragments = new Vector&lt;Fragment&gt;();
        fragments.add(Fragment.instantiate(this, testActivity.class.getName()));
        fragments.add(Fragment.instantiate(this, test2Activity.class.getName()));
        this.mPagerAdapter  = new PagerAdapter(super.getSupportFragmentManager(), fragments);


        ViewPager pager = (ViewPager)super.findViewById(R.id.viewpager);
        TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
        pager.setAdapter(this.mPagerAdapter);
        indicator.setViewPager(pager);
    }
}
</code></pre>

<p>testActivity:</p>

<pre><code>public class test extends FragmentActivity { //or activity?

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout);
  { 

}
</code></pre>
