List of utility methods to do Preference
void | savePreference(String key, Object value) save Preference if (value instanceof String) { prefs.put(key, (String) value); } else if (value instanceof Boolean) { prefs.putBoolean(key, (Boolean) value); } else if (value instanceof Integer) { prefs.putInt(key, (Integer) value); |
Preferences | userNodeForClass(Class> clazz) user Node For Class final Preferences prefs = Preferences.userNodeForPackage(clazz); return prefs.node(clazz.getSimpleName()); |
void | writeReg2(String name, String value, Class> clazz) write Reg Preferences prefsdemo = Preferences.systemNodeForPackage(clazz); try { prefsdemo.put(name, value); } catch (Exception e) { |