wood burning stoves*
The moose likes Android and the fly likes maintaining custom view state after phone rotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "maintaining custom view state after phone rotation" Watch "maintaining custom view state after phone rotation" New topic
Author

maintaining custom view state after phone rotation

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
Hello,

I am trying to find the best way maintain state on my custom view when users rotate their phone. The custom view has an instance variable which is of type Board (my creation). Board in turn contains instance variables which are custom objects themselves. I looked into the Parcelable approach but it doesn't appear possible to "chain" Parcelables for recreating my object graph. Another idea that came to mind would be to use onRetainNonConfigurationInstance() to store the custom view itself, but after that thought, I felt I had to take a shower. I'm pretty new to Android so I am looking for other possible approaches.

Thanks, Eric
 
 
subject: maintaining custom view state after phone rotation