views:

23

answers:

0

Basically I want to dynamically change the tabs from an Activity. At first I thought I would delete a tab and create a new one ... Nope, not without completely removing / recreating all tabs. My second thought was to have all the possible tabs created and set their visibility as needed. Hummm...can't seem to do that either. Does anyone know how to do the remove/recreate (single tab) or setVisibility on a specific tab? TIA

Note, I can get to the view of the tab and change it's background color so I would have expected changing the visibility there would work but it didn't.

Method in activity started by tabActivity intent: private void updateTabs() { TabHost tabHost = ((TabActivity) getParent()).getTabHost(); View tabIndicatorView = tabHost.getCurrentTabView(); tabIndicatorView.setBackgroundColor(0); //works tabIndicatorView.setVisibility(2); //doesn't work tabHost.getTabWidget().getChildAt(currentTab).setVisibility(2); //doesn't work either }