@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tabhost_container); tabHost = (TabHost)this.findViewById(R.id.tabhost); tabHost.setup(); tabHost.addTab(tabHost.newTabSpec("one").setContent(R.id.tab1content).setIndicator("TAB 1")); tabHost.addTab(tabHost.newTabSpec("two").setContent(R.id.tab2content).setIndicator("TAB 2")); tabHost.findViewById(R.id.tab1button).setOnClickListener(goToTab2()); tabHost.findViewById(R.id.tab2button).setOnClickListener(goToTab1()); }
TabWidget tw = (TabWidget)tabHost.findViewById(android.R.id.tabs); View tabView = tw.getChildTabViewAt(0); TextView tv = (TextView)tabView.findViewById(android.R.id.title); TabWidget tw = (TabWidget)tabHost.findViewById(android.R.id.tabs); View tabView = tw.getChildTabViewAt(0); TextView tv = (TextView)tabView.findViewById(android.R.id.title); TabWidget tw = (TabWidget)tabHost.findViewById(android.R.id.tabs); for(i=0;i<2;i++)
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.date_range_picker, container, false); getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); tabHost = (TabHost) root.findViewById(R.id.tabHost); butSetDateRange = (Button) root.findViewById(R.id.but_set_time_range); startDatePicker = (DatePicker) root.findViewById(R.id.start_date_picker); endDatePicker = (DatePicker) root.findViewById(R.id.end_date_picker); butSetDateRange.setOnClickListener(this); tabHost.findViewById(R.id.tabHost); tabHost.setup(); TabHost.TabSpec startDatePage = tabHost.newTabSpec("start"); startDatePage.setContent(R.id.start_date_group); startDatePage.setIndicator(getString(R.string.title_tab_start_date)); TabHost.TabSpec endDatePage = tabHost.newTabSpec("end"); endDatePage.setContent(R.id.end_date_group); endDatePage.setIndicator(getString(R.string.ttile_tab_end_date)); tabHost.addTab(startDatePage); tabHost.addTab(endDatePage); return root; }
TabHost.TabSpec spec = mTabHost.newTabSpec(tag); View tabIndicator = LayoutInflater.from(context).inflate(resourse, (TabWidget)mTabHost.findViewById(android.R.id.tabs), false);
tabHost.findViewById(R.id.tabHost); tabHost.setup(); tabHost.setCurrentTab(1); if (fontName != null) { final TabWidget tw = tabHost.findViewById(android.R.id.tabs); for (int i = 0; i < tw.getChildCount(); ++i) { final View tabView = tw.getChildTabViewAt(i);
tabHost.findViewById(R.id.tabHost); tabHost.setup(); TabHost.TabSpec startDatePage = tabHost.newTabSpec("start"); tabHost.setCurrentTab(1); if (fontName != null) { final TabWidget tw = tabHost.findViewById(android.R.id.tabs); for (int i = 0; i < tw.getChildCount(); ++i) { final View tabView = tw.getChildTabViewAt(i);