1

I use Tab Widget like in documentation example TabWidget

I have two tabs, and in every tab when I press some button I need to load another different activity. My question is how to achive that I have that two tab on another activities like headers ? I could create that tabs in new activities but it wouldn't remember choosen activity for another tab. How to solve this ?

Damir
  • 54,277
  • 94
  • 246
  • 365
  • To clarify, you are trying to reload a new Activity into your current tab? – nEx.Software Feb 16 '11 at 17:20
  • Yes, new activity in my tab, but not to change another in second tab . And viceversa. – Damir Feb 16 '11 at 17:43
  • seems like this [another thread on stackoverflow][1] can help [1]: http://stackoverflow.com/questions/1306689/launching-activities-within-a-tab-in-android – Rakib Aug 13 '11 at 18:46

1 Answers1

1

This is not possible out of the box. The normal TabHost doesn't provide any facility to change the content of a tab after it is created. If you can use views as your tab content, you can, however, flip between the views within a tab so that to get the effect you are after.

If you absolutely must use a new Activity, then you will have to implement your own TabHost which allows swapping tab content after it is created.

nEx.Software
  • 6,782
  • 1
  • 26
  • 34