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.

Charles
  • 50,943
  • 13
  • 104
  • 142
smukov
  • 626
  • 7
  • 18
  • surely, the best would be to use bundles? – Raunak Apr 10 '12 at 01:40
  • 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. – smukov Apr 10 '12 at 03:11

1 Answers1

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.

Optimus
  • 15
  • 1
  • 8