2

So, I'm making a trivia game and so I created a custom array of questions. I have an xml file in the raw folder that holds all the questions, and parses everything into my array. I want to have the ability to shuffle all the questions after the user is done with a game and starts a new one.

This is really easy to implement - just shuffle the array! The problem I run into is saving things. With Shared Preferences, I can save the index (question the user was at) when they close the app. But when I shuffle the array, and they leave the app and go back in - the array is back to the default array so the shuffle is kind of moot. You obviously can't save arrays with shared prefs - so does anyone know a simple/easy way to save the shuffled array?

1 Answer 1

1

Serialize and http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

Sign up to request clarification or add additional context in comments.

1 Comment

Right - I could do that. But...isn't it kind of overkill to go to all the work to serialize things just to save one array? Is there really no simpler alternative?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.