method:newTabSpec ( String tag )
return type:TabHost.TabSpec
content:ใช้สร้าง Object TabHost.TabSpec
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
TabHost tab_host = new TabHost ( this );
tab_host.setup();
TabHost.TabSpec tab_spec_1 = tab_host.newTabSpec ( "tag_one" );
Button button = new Button ( this );
tab_spec_1.setContent ( button.getId ( ) );
tab_spec_1.setIndicator( "TestButton" );
tab_host.addTab ( tab_spec_1 );
TabHost.TabSpec tab_spec_2 = tab_host.newTabSpec ( "tag_two" );
TextView text_view = new TextView ( this );
tab_spec_2.setContent ( text_view.getId ( ) );
tab_spec_2.setIndicator( "TestTextView" );
tab_host.addTab ( tab_spec_2 );
TabWidget tab_widget = tab_host.getTabWidget ( );
setContentView ( tab_host );
}
}