Skip to content

Instantly share code, notes, and snippets.

@donrokzon
Last active June 29, 2018 04:36
Show Gist options
  • Select an option

  • Save donrokzon/9d27a18234a8f914670ab2a505ae7eee to your computer and use it in GitHub Desktop.

Select an option

Save donrokzon/9d27a18234a8f914670ab2a505ae7eee to your computer and use it in GitHub Desktop.
Shared Preference
SharedPreferences sharedPreferences;
SharedPreferences.Editor editor;
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
editor = sharedPreferences.edit();
editor.putString("ID", id);
editor.commit();
String id= sharedPreferences.getString("ID", null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment