I want to store the last X values that a user input into a form. I have a list of 20 values and every time the user enters a new one, the oldest value is pushed out of the list and the newest value goes in. I want this list to persist between app launches, but sharedpreferences doesn't support an ordered set, so the results will end up jumbled every time. How can I store the list in an ordered form that I can then retrieve?
Set<String> previousValues = sharedPreferences.getStringSet(getString(R.string.LAST_VALUES), null);