How to go from an Activity to a specific Activity inside a TabActivity?
<p>I would like to go from an Activity, with a click on a button to a specific Activity inside a TabActivity.
How would I be able to perform that?</p>

<p>Here's my TabActivity:</p>

<pre><code>public class CustomTab extends ActivityGroup {

    public static final String TAB_ID = null;
    private TabHost mTabHost;

    private void setupTabHost() {
        mTabHost = (TabHost) findViewById(android.R.id.tabhost);
        mTabHost.setup(this.getLocalActivityManager());
    }

    /** Called when the activity is first created. */

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // construct the tabhost
        setContentView(R.layout.custom_tab);

        setupTabHost();

        mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);

        setupTab(new TextView(this), "HELFOMAT", (MainActivity.class));
        setupProjectTab(new TextView(this), "PROJEKTE", (ProjectTab.class));
        setupContactTab(new TextView(this), "KONTAKT", (ContactActivity.class));
        setupInfoTab(new TextView(this), "INFOS", (InfosActivity.class));
    }

    private void setupTab(final View view, final String tag, final Class&lt;?&gt; context) {
        View tabview = createTabView(mTabHost.getContext(), tag);

        TabSpec ts1 = mTabHost.newTabSpec("TAB_DATE"); 
        ts1.setIndicator(tabview); 
        ts1.setContent(new Intent(this,context)); 

        mTabHost.addTab(ts1);

    }

    private static View createTabView(final Context context, final String text) {
        View view = LayoutInflater.from(context).inflate(R.layout.tab_helfomat_bg, null);
        TextView tv = (TextView) view.findViewById(R.id.tabsText);
        tv.setText(text);
        return view;
    }

    private void setupContactTab(final View view, final String tag, final Class&lt;?&gt; context) {
        View tabview = createContactTabView(mTabHost.getContext(), tag);
        TabSpec ts1 = mTabHost.newTabSpec("TAB_DATE"); 
        ts1.setIndicator(tabview); 
        ts1.setContent(new Intent(this,context)); 

        mTabHost.addTab(ts1);

    }

    private static View createInfoView(final Context context, final String text) {
        View view = LayoutInflater.from(context).inflate(R.layout.tab_info_bg, null);
        TextView tv = (TextView) view.findViewById(R.id.tabsText);
        tv.setText(text);
        return view;
    }

    private void setupInfoTab(final View view, final String tag, final Class&lt;?&gt; context) {
        View tabview = createInfoView(mTabHost.getContext(), tag);
        TabSpec ts1 = mTabHost.newTabSpec("TAB_DATE"); 
        ts1.setIndicator(tabview); 
        ts1.setContent(new Intent(this,context)); 

        mTabHost.addTab(ts1);

    }

    private static View createContactTabView(final Context context, final String text) {
        View view = LayoutInflater.from(context).inflate(R.layout.tab_contact_bg, null);
        TextView tv = (TextView) view.findViewById(R.id.tabsText);
        tv.setText(text);
        return view;
    }

    private void setupProjectTab(final View view, final String tag, final Class&lt;?&gt; context) {
        View tabview = createProjectTabView(mTabHost.getContext(), tag);
        TabSpec ts1 = mTabHost.newTabSpec("TAB_DATE"); 
        ts1.setIndicator(tabview); 
        ts1.setContent(new Intent(this,context)); 

        mTabHost.addTab(ts1);

    }

    private static View createProjectTabView(final Context context, final String text) {
        View view = LayoutInflater.from(context).inflate(R.layout.tab_project_bg, null);
        TextView tv = (TextView) view.findViewById(R.id.tabsText);
        tv.setText(text);
        return view;
    }
}
</code></pre>
