method:setup ( )
return type:void
content:จะต้องเรียกใช้คำสั่งนี้ ก่อนที่จะ เพิ่ม tabSpec เข้าไปใน Object TabHost เสมอ
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 );
setContentView ( tab_host );
}
}