Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

maintaining custom view state after phone rotation  RSS feed

Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!