[Tabs3.java]

public class Tabs3 extends TabActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final TabHost tabHost = getTabHost();

        tabHost.addTab(tabHost.newTabSpec("tab1")
                .setIndicator("list")
                .setContent(new Intent(this, List1.class)));

        tabHost.addTab(tabHost.newTabSpec("tab2")
                .setIndicator("photo list")
                .setContent(new Intent(this, List8.class)));
       
        // This tab sets the intent flag so that it is recreated each time
        // the tab is clicked.
        tabHost.addTab(tabHost.newTabSpec("tab3")
                .setIndicator("destroy")
                .setContent(new Intent(this, Controls2.class)
                        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
    }
}

'old > API_Demo' 카테고리의 다른 글

Views_Visibility  (0) 2010.05.06
Views_TextSwitcher  (0) 2010.05.06
Views_Tabs_Content By Factory  (0) 2010.05.06
Views_Tabs_Content By Id  (0) 2010.05.06
VIews_SeekBar  (0) 2010.05.06
Posted by jazzlife
,