I\'m using a TabHost to render some tabs. In the XML definition everything is set up ~normally, a RelativeLayout is the only child of the FrameLayout for the TabHost.
W
I ended up spending some time reading TabHost.java and discovered what was happening.
TabHost.java (naively IMO ;) ) assumes that different tabs are attached to different content views.
Every time a content view is added to a TabSpec the visibility of the view is set to GONE.
Every time a TabSpec is added to the TabHost, the TabHost switches to tab 0.
Every time setCurrentTab is called the visibility of the View of that tab is set to VISIBLE if and only if the newly selected tab is not the current tab.
When a bunch of tabs are added for the same view:
So this was caused by using the same view for the content of multiple tabs.
So, to fix this call: tabHost.getCurrentView().setVisibility(View.VISIBLE); ... after adding all the tabs