Skip to content

Instantly share code, notes, and snippets.

@jezinka
Created Dec 10, 2017
Embed
What would you like to do?
private void setupSharedPreferences() {
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
planLength = Integer.parseInt(defaultSharedPreferences.getString("plan_length", getString(R.string.plan_length_default_value)));
firstDayOfWeek = Integer.parseInt(defaultSharedPreferences.getString("first_day", getString(R.string.first_day_default_value)));
defaultSharedPreferences.registerOnSharedPreferenceChangeListener(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment