开发者

TabWidget problem with new activities

开发者 https://www.devze.com 2023-02-11 02:15 出处:网络
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 ac

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 ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消