80,361
社区成员
发帖
与我相关
我的任务
分享
private void addTab(String tag, String text, Class<?> activityClass, Drawable drawable) {
Intent intent = new Intent();
intent.setClass(this, activityClass);
TabHost.TabSpec tabSpec = mTabHost.newTabSpec(tag);
tabSpec.setIndicator(text, drawable);
tabSpec.setContent(intent);
mTabHost.addTab(tabSpec);
}
}