Answers for "android java get sharedpreferences example"

1

get preference value android

boolean mBoolean = PreferenceManager.getDefaultSharedPreferences(yourContext).getBoolean(key, defaultValue); //getBoolean will return defaultValue is key isn't found
//you can also use getInt, getFloat, getLong, getString, getStringSet and change the variable type, of course
Posted by: Guest on March-16-2020
0

save integer android studio

SharedPreferences.Editor mEditor = mPrefs.edit();
mEditor.putString("tag", value_of_variable).commit();
Posted by: Guest on November-04-2020

Code answers related to "android java get sharedpreferences example"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language