I have a layout where I need tabs inside a sub-layout, not in the action bar. I.e., The tabs do not apply to the entire screen display, only to one of the panes.
How can I do this in Android 4.0+?
I have a layout where I need tabs inside a sub-layout, not in the action bar. I.e., The tabs do not apply to the entire screen display, only to one of the panes.
How can I do this in Android 4.0+?
You can do this using the support library and a FragmentTabHost. Google has an example here. In your layout file you can embed the android.support.v4.app.FragmentTabHost
that's shown in the example inside another layout, such as a pane.
Another option is to use scrollable tabs. They also can be imbedded anywhere in a layout. Google gives a code example here. The view that you will imbed in your pane is the android.support.v4.view.ViewPager
with a android.support.v4.view.PagerTitleStrip
as it's subview. This example also has a sample project that you can download (the example project doesn't have the scrollable tabs imbedded inside another layout, but it's a good starting point).