Saving the state of the child activities of an ActivityGroup when rotating the screen

I have an ActivityGroup inside a TabHost and the ActivityGroup has multiple child activities.

When the device is rotated, the tab does not save its state (I know that when the orientation is changed, the operations are updated).

What's the best practice to save the state of the child Activity of an ActivityGroup that was shown before the screen was rotated?

Please note that I may need to save the states of each child Activity of the ActivityGroup.

+3


source to share


1 answer


I used the following in AndroidManifest to keep the view from destroyed, but it doesn't work:

 android:configChanges="orientation"

      

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

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

      



to

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

      

It seems that my environment was having problems with a different target version as it was recognized and added automatically.

+2


source







All Articles