method:getCurrentTab ( )
return type:int
content:ใช้คืนค่า ตำแหน่งของ Tab ปัจจุบัน ที่กำลัง Focus อยู่
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 );
int current_tab = tab_host.getCurrentTab ( );
setContentView ( tab_host );
}
}