I created a simple TabActivity that builds tabs at runtime by reading some JSON data. I am currently initializing an empty ListActivity with empty random elements for each tab, to see that switching from tab to tab works and the content does not disappear. The actual content for the tabs is stored in a singleton class, so when bookmark actions are re-created due to a change in screen orientation, they simply pull the correct dummy items from the corresponding list according to the identifier that is included with the intentions additions.
Everything works perfectly. I placed the onCreate list activity log to see how actions are recreated on the rotation screen, and they do it. However, there is something strange in that the activity for the first tab is always recreated, even if it is not visible. When I switch to the third or fourth tab and rotate the device, the previous tabs are killed and not recreated again, except for the first tab. The first tab is always there. What for? I would understand the error in the code, but the activity of the tabs is copied from the tutorial, and the activity of the list is the same for all tabs. Here are some logs I get:
List created with 1
onConfigurationChanged
List created with 1
List created with 2
List created with 4
List created with 5
List created with 6
onConfigurationChanged
List created with 1
List created with 6
onConfigurationChanged
List created with 1
List created with 6
onConfigurationChanged
List created with 1
onConfigurationChanged
List created with 1
List created with 2
onConfigurationChanged
List created with 1
List created with 2
onConfigurationChanged
List created with 1
List created with 2
List created with 4
onConfigurationChanged
List created with 1
List created with 4
onConfigurationChanged
List created with 1
List created with 4
List created with 5
onConfigurationChanged
List created with 1
List created with 5
onConfigurationChanged
List created with 1
List created with 5
, , , . , , . onCreate. , . , , !
? - ? API HTC Legend 7.
UPDATE. TabActivity, , , , ? , , ? :
onConfigurationChanged
Tab: Saving tab index 3
...
Tab: Adding tab 1
List created with 1
Tab: Adding tab 2
Tab: Adding tab 3
Tab: Adding tab 4
Tab: Adding tab 5
Tab: Setting tab to index 3
List created with 5