I need to show tab content on occasion, otherwise the area must be filled with "non-tabhost" data.However, tabs should be visible and when user clicks any of those tabs "non-tabhost" must be hidden and appropriate tab content must become visible.
It's something connected to a fake tab creation ?
Give an example of creating TabHost with tabs unselected. Thanks.
1.copy the code where you want to tabs make unselected
2.Override on Tabselected Listener and paste the following code
What I usually do is, add an extra
Tab
and usesetVisibility(View.GONE)
to hide it. THis will just hide the tab button from the user, and theTab
will still be there, in the "background" and you can programmatically select it, by usingtabHost.setCurrentTab(0)
. I also usually keep this tab as the first one.