Android TabHost inside Fragment

后端 未结 3 1155
无人及你
无人及你 2021-01-02 14:13

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 p

相关标签:
3条回答
  • 2021-01-02 14:58

    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/

    0 讨论(0)
  • 2021-01-02 15:05

    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

    0 讨论(0)
  • 2021-01-02 15:06

    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.

    0 讨论(0)
提交回复
热议问题