manuelBetancurt
manuelBetancurt

Reputation: 16128

android tabHost with many activities inside each tab

I have an android app that should go to a different activity when a tab is tapped,

but once in that tab, the user should be able to go to different activities [views] inside that tab,

I have found this multiple activities in tab

But I wonder if this is the best and simplest approach, to have a TabGroupActivity that extends ActivityGroup,

or is there other preferred way to have multiple activities in my tabs?

edit, is it a better approach to use fragments as aneal suggest?

thanks!

ps. I want to use this app for mobile phones, with a minimum OS v 2.1

So do fragments work with old OS? and in a handset phone?

;)

Upvotes: 1

Views: 687

Answers (2)

Zoombie
Zoombie

Reputation: 3610

Multiple Activities you found using this, is using ActivityGroup which is now deprecated, and suggested to use Fragments in place of it.

To support android devices 2.1+ and higher in you case, you can surely use Android support packages which are available for download. And compatible fragment work for Android device with v1.6 and higher, if you wish to work with fragments.

Upvotes: 2

andyandy
andyandy

Reputation: 928

As commented by aneal use fragments. You find some examples in the SDK. Here is an article that goes through the same thing as shown in the "Fragment tabs" SDK example.

Upvotes: 2

Related Questions