Tab layout programmatically in android
<p>I need to use tab layout in which i try to access two activity classes in 2 tabs programmatically. I tried but getting error in run time. refer my code below,test activity</p>

<pre><code>public class TestActivity extends TabActivity {
    protected static final View View = null;

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


        Resources ressources = getResources(); 
        TabHost tabHost = getTabHost(); 
        // Android tab
                Intent intentAndroid = new Intent().setClass(this, AndroidActivity.class);
                TabSpec tabSpecAndroid = tabHost
                  .newTabSpec("Android")

                  .setContent(intentAndroid);

                tabHost.addTab(tabSpecAndroid); 
        setContentView(tabHost);

    }
}
</code></pre>

<p>Android activity(activity which need to display in tab order in the name as <code>andriod</code>)</p>

<pre><code>import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class AndroidActivity extends Activity 
{
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        TextView textview = new TextView(this);
        textview.setText("This is Android tab");
        setContentView(textview);
    }
}
</code></pre>

<p>I don't know whats wrong in it. please give simple sample for <code>TabLayout</code> programmatically(without using any xml files).</p>
