getTabHost() method in undefined
<p>I am making tabs in android. I am using TabHost to achieve this. I am getting red line under <code>getTabHost()</code> method on this line <code>TabHost tabHost = getTabHost();</code>. I am not sure why am I getting this. How can I make this example work?</p>

<p>Here is my complete code</p>

<pre><code>public class TabActivity extends Activity {
//TabHost mTabHost;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Resources res = getResources(); // Resource object to get Drawables
    TabHost tabHost = getTabHost();  // The activity TabHost
    TabHost.TabSpec spec;  // Resusable TabSpec for each tab
    Intent intent;  // Reusable Intent for each tab

    //Artist Tab
    intent = new Intent(this, Artist.class);
    spec = tabHost.newTabSpec("artists").setIndicator("Artist", res.getDrawable(R.drawable.tab_icon)).setContent(intent);
    tabHost.addTab(spec);

  //Songs
    intent = new Intent(this, Songs.class);
    spec = tabHost.newTabSpec("songs").setIndicator("Songs", res.getDrawable(R.drawable.tab_icon)).setContent(intent);
    tabHost.addTab(spec);

  //Albums
    intent = new Intent(this, Album.class);
    spec = tabHost.newTabSpec("artists").setIndicator("Artist", res.getDrawable(R.drawable.tab_icon)).setContent(intent);
    tabHost.addTab(spec);

    tabHost.setCurrentTab(1);
}
}
</code></pre>
