How can I use fragments, now TabActivity is deprecated?

I have a main activity with a dock below, with 4 icons: A, B, C, D.

I already tried to get an answer to the question here related to replacing a fragment on this tab, but not getting an answer. I began to think that maybe I went the wrong way. So now I have come up with a new way to implement it, which basically forces me to use the now obsolete TabActivity. The question is why is it out of date?

My idea is to implement the system as such:

TabActicity(TabActivity)
Tab A(FragmentActivity) -> Fragments
Tab B(FragmentActivity) -> Fragments
Tab C(FragmentActivity) -> Fragments
Tab D(FragmentActivity) -> Fragments

The value of each tab has its own fragmentation that its fragments. Is this a way to implement the system instead of having FragmentActivity as my TabController and using snippets as each individual tab?

+1
source share
1 answer

In Android docs you will find an example of using TabHost with fragments. No need for TabActivity. Here is an example: http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html

+1
source

All Articles