Skip to content

Instantly share code, notes, and snippets.

@JulienGenoud
Created October 27, 2015 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JulienGenoud/ef7e7f793232bee10155 to your computer and use it in GitHub Desktop.
Save JulienGenoud/ef7e7f793232bee10155 to your computer and use it in GitHub Desktop.
sharedpref helper
private static SharedPreferences preferences;
private static SharedPreferences getAppPreference(Context context) {
if (preferences == null) {
preferences = context.getSharedPreferences(APP_PREFERENCE_NAME, Context.MODE_PRIVATE);
}
return preferences;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment