Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

maintaining custom view state after phone rotation

Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic