Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Interactive Story Lesson: how to save your game progress?

I finished this lesson a few days ago and decided to mess around with the project a bit. I added pages, texts, more buttons, etc just to get really familiar with the code but ran into a problem. How do I save my progress in the app? I figured out how to use onResume to recall the current view I was in if I come out of the project BUT, if I force close it / turn off the phone etc, I have to start all over again. How do I save my progress?

PS. I am assuming this might be covered in future projects/lessons and if that is the case, where?

(I googled several things that might do it but have no idea what applies to this specific type of app.)

1 Answer

Data Persistence (saving progress, preferences, files, etc.) is covered in this module: https://teamtreehouse.com/library/android-data-persistence.