1

I have a main activity with a sort of dock at the bottom, with 4 icons: A, B, C, D.

I already tried getting a response to a question here involving replacing a fragment within a given tab but did not get an answer. I began to think that maybe I was heading down a wrong path. So now I thought up a new way of implementing it which basically forces me to use the now deprecated TabActivity. The question is, why is it deprecated?

My idea is to implement a system as such :

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

Meaning each Tab has its own fragmentActivity that its fragments. Is this the way of implementing the system instead of having a FragmentActivity as my TabController and using fragments as each individual tab ?

Community
  • 1
  • 1
CodePrimate
  • 6,646
  • 13
  • 48
  • 86
  • 3
    *"[..] did not get an answer.[..]"* - 3 hours are sometimes not enough to get an answer, depending on the question and the people who see it. Be a bit more patient. Also I noticed at lot of code in your linked question. I dídn't read it in detail, but maybe you can cut that down a bit to the relevant details. People will most likely come in, see a wall of code and go "oh no thanks". The faster your question can be parsed, the better *(but don't cut relevant details. Yes, this is a fine line there)*. –  Mar 26 '12 at 11:15
  • 1
    Ive edited out a bit more of the code. Hopefully the message still comes across clearly. – CodePrimate Mar 26 '12 at 11:19
  • possible duplicate of [Creating a tabs using Fragments now that TabActivity is deprecated](http://stackoverflow.com/questions/7599816/creating-a-tabs-using-fragments-now-that-tabactivity-is-deprecated) – Casebash Aug 09 '12 at 05:23

1 Answers1

1

In the Android docs you find an example of how to use a TabHost with Fragments. No TabActivity needed. Here is the example: http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html

Stefan
  • 4,645
  • 1
  • 19
  • 35
  • 1
    The link seems to be expired. The sample included with Android sdk support library in /extras/android/support/samples/Support4Demos contains a Fragment Tabs example which helped me. – Atul Goyal Feb 13 '13 at 14:57