[Tabs2.java]
public class Tabs2 extends TabActivity implements TabHost.TabContentFactory {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final TabHost tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("tab1")
.setIndicator("tab1", getResources().getDrawable(R.drawable.star_big_on))
.setContent(this));
tabHost.addTab(tabHost.newTabSpec("tab2")
.setIndicator("tab2")
.setContent(this));
tabHost.addTab(tabHost.newTabSpec("tab3")
.setIndicator("tab3")
.setContent(this));
}
/** {@inheritDoc} */
public View createTabContent(String tag) {
final TextView tv = new TextView(this);
tv.setText("Content for tab with tag " + tag);
return tv;
}
}
'old > API_Demo' 카테고리의 다른 글
Views_TextSwitcher (0) | 2010.05.06 |
---|---|
Views_Tabs_Content By Intent (0) | 2010.05.06 |
Views_Tabs_Content By Id (0) | 2010.05.06 |
VIews_SeekBar (0) | 2010.05.06 |
Views_Spinner (0) | 2010.05.06 |