tags:

views:

40

answers:

1

Hello everyone!

I have an annoying problem with TabActivity. I have several activities in it and when I switch between them each of them gets recreated and loses all its info :(

I've tried using android:launchMode="singleTop" but no luck :(

Any clues?

+1  A: 

Here is a sample project showing the use of activities in tabs that does not suffer from the problem you cite.

Even better would be to get rid of the activities and just use views as the contents of your tabs, as that will save RAM, CPU, and battery life. See this project for a sample.

CommonsWare
Thanks for your help. View example is too simple. Are those views created on each tab switch? Also are custom views supported?
Kostia Dombrovsky
"Are those views created on each tab switch?" No, they are created when the activity is started up. "Also are custom views supported?" Sure, no different than with any other layout.
CommonsWare