Preserving the state of ActivityGroup's child activities on screen rotation [duplicate]
Asked Answered
P

1

7

I have an ActivityGroup inside a tab of the TabHost, and that ActivityGroup has multiple child activites.

When device is rotated the tab doesn't preserve it's state (I'm aware that on orientation changes activities are restared).

What is the best practice to keep the state of the ActivityGroup's child activity that was shown before the screen rotation?

Note that I may need to keep the states of every child activity of the ActivityGroup.

Phyla answered 10/4, 2012 at 1:32 Comment(2)
surely, the best would be to use bundles?Walking
sure, but how exactly? I'm wondering if there is some widely known and easy way to do this when ActivityGroup and it's child activities are concerned.Phyla
K
2

I used the following in the AndroidManifest to save the views from beeing destroyed but it did not work:

 android:configChanges="orientation"

I just solved my problem by changing in the AndroidManifest.xml this line :

<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="15" />

to

<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="11" />

Seems like my environment had trouble with a different target version as it recognized and added it automaticaly.

Knuckle answered 13/7, 2012 at 20:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.