简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM