Reputation: 1016
I am working on an Android App and I have used android FragmentPager tabs example from developer.android.com), this example uses fragments for tabs contents, Now I want to place a tabHost inside one of those fragments, I have tried my best but the second tab hosts are not showing the content, I can see tab headers but no content, I am trying to use Intents as TabContent. I don't think I have any relevant code to post here, but If you need I can post it here.
The hierarchy is: FragmentActivity->TabHost->Fragments->TabHost->(Intent or Fragment, this is the problem area)
Any Suggestion would be appreciated.
Upvotes: 8
Views: 26134
Reputation: 2978
Now you can use FragmentTabHost
This can also be used inside of a fragment through fragment nesting
http://developer.android.com/reference/android/support/v4/app/FragmentTabHost.html
Upvotes: 4
Reputation: 303
I face the same problem we. We cannot open a fragment or activity in another tab.(We an but it will open in the same tab). So i am use to the below code to change the tab.
MainActivity.tabHost.setCurrentTab(tabIndex);
Its open the tab with the main tab page.
Upvotes: 1
Reputation: 30804
Have you seen this? I've referenced it a few times, should help you out.
http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/
Upvotes: 4