Skip to content
Sumeet Kumar edited this page Jul 10, 2015 · 1 revision

SharedPreferences easy to use

i used it in mostly of my apps

to initialize

Prefs prefs = new Presfs(this);

for saving value

prefs.set(key, default);

for retrieving

Sting name = prefs.get(key);

int num = prefs.get(key);

boolean value = prefs.get(key);

float var = prefs.get(key);

Double double = prefs.get(key);

no need to intialize SharedPreferences No Editor

No any apply(); or commit();

Clone this wiki locally