List of utility methods to do SharedPreferences Get
Boolean | getPrefBoolean(SharedPreferences pref, String key) get Pref Boolean Object value = getPrefObject(pref, key);
return value != null ? (Boolean) value : null;
|
Boolean | getPrefBoolean(SharedPreferences pref, String key) get Pref Boolean Object value = getPrefObject(pref, key);
return value != null ? (Boolean) value : null;
|
int | getPrefInt(SharedPreferences pref, String key, String default_value) get Pref Int int ret = getPrefInt(pref, key, Integer.MIN_VALUE); if (ret == Integer.MIN_VALUE) { ret = Integer.parseInt(default_value); return ret; |
int | getPrefInt(SharedPreferences pref, String key, int default_value) get Pref Int Object value = getPrefObject(pref, key); int ret = default_value; if (value != null && value instanceof String) { String str = (String) value; if (MyStringUtlis.isEmpty(str) == false) { try { ret = Integer.parseInt(str); } catch (Throwable e) { ... |
Object | getPrefObject(SharedPreferences pref, String key) get Pref Object Map<String, ?> all = pref.getAll(); if (all != null) { Object obj = all.get(key); return obj; return null; |
Object | getPrefObject(SharedPreferences pref, String key) get Pref Object Map<String, ?> all = pref.getAll(); if (all != null) { Object obj = all.get(key); return obj; return null; |
boolean | getPrefBoolean(Context c, String key, boolean defValue) get Pref Boolean SharedPreferences sp = PreferenceManager
.getDefaultSharedPreferences(c);
return sp.getBoolean(key, defValue);
|
int | getPrefInt(Context c, String key, int defValue) get Pref Int SharedPreferences sp = PreferenceManager
.getDefaultSharedPreferences(c);
return sp.getInt(key, defValue);
|
String | getPrefString(Context c, String key, String defValue) get Pref String SharedPreferences sp = PreferenceManager
.getDefaultSharedPreferences(c);
return sp.getString(key, defValue);
|
byte[] | getSaltFromPreferences(SharedPreferences prefs) get Salt From Preferences return decode(getStringFromPrefsOrThow(prefs, KEY_PR_SALT));
|