Want more features on Pastebin? Sign Up, it's FREE!
Guest

Simple example of Android SharedPreferences

By: a guest on Mar 30th, 2010  |  syntax: Java 5  |  size: 0.20 KB  |  views: 722  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SharedPreferences prefs = getSharedPreferences( Constants.Settings.GLOBAL_PREFS, Context.MODE_PRIVATE );
  2. Editor editor = prefs.edit();
  3. editor.putInt( Constants.Settings.KEY_AUTOSIGNIN, 1 );
  4. editor.commit();
clone this paste RAW Paste Data