Removing a tab and the activity (intent) inside of it from a TabHost
问题 I have an app that can create tabs dynamically. And when I create a tab I initiate an activity as an intent. Like so: private void addTab(Context packageContext, Class<?> newClass, TabHost mTabHost, String tabId, String tabLabel){ // newClass is my Activity class that I want to start in the tab Intent intent = new Intent().setClass(packageContext, newClass); TabHost.TabSpec spec; spec = mTabHost.newTabSpec(tabId).setIndicator(tabLabel) .setContent(intent); mTabHost.addTab(spec); mTabHost