Kostia Dombrovsky
Kostia Dombrovsky

Reputation: 1647

Child Activity gets created from scratch after switching tabs in a TabActivity

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?

Upvotes: 1

Views: 196

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

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.

Upvotes: 1

Related Questions