As you have a minimum SDK of 14
(and I think you're not using a ViewPager
?!) it would make sense to use the SDK version of the fragments framework. A FragmentTabHost
is a convenience wrapper around a TabHost
to make working with fragments as tabs easier. I don't recall seeing an equivalent for FragmentTabHost
in the SDK so you would have two options:
- Use a standard
TabHost
and implement your own logic to switch the fragments when the tab changes - Copy the code for the
FragmentTabHost
and change it to work with the SDK version of the fragments framework. If I remember right the code for theFragmentTabHost
is fairly simple and a copy-paste followed by changing the imports should work.
However, it seems you want to use the FragmentTabHost
with nested fragments(the fragment tabs being part of another bigger fragment), in this case you need to use the fragments from the support library(along with FragmentTabHost
) because the support for nested fragments was introduced in the SDK starting with 4.2
which means that any version between 4.0 and 4.2 will not be able to use nested fragments.