I have several custom components which extends LinearLayout.
Now I want to save/restore their state when screen orientation changes, but I can’t do it from activity’s onSaveInstanceState/onRestoreInstanceState because I need it to be flexible. It means I have to override those functions in the LinearLayout directly, but I couldn’t find any examples.
Can somebody show me a code snippet how can I use it to store several strings and booleans? Of course every component have an unique ID.
Thanks in advance
The solution is to create custom
Parcelablefor the component and use it inonSaveInstanceStateandonRestoreInstanceState. A bit more detailed explanation can be found here: http://prasanta-paul.blogspot.com/2010/06/android-parcelable-example.html