Browse Tag

SharedPreferences

SharedPreferences helper class example

Set:

ShPref.put(R.string.some_key, System.currentTimeMillis());
//...
ShPref.put("some_hard_coded_key", System.currentTimeMillis());

Get:

ShPref.getLong(R.string.some_key, -1); // -1 default value
//...
ShPref.getLong("some_hard_coded_key", -1); // -1 default value

Keep Reading