Answers for "implement sharedpreferences in android"

6

android sharedpreferences

// load file
SharedPreferences sharedPref = getSharedPreferences(PREFERENCES_FILENAME, MODE_PRIVATE);

// read value
String value = sharedPref.getString(PREFERENCE_KEY, null);

// write value
sharedPref.edit()
  .putString(PREFERENCE_KEY, value)
  .apply();
Posted by: Guest on April-19-2021

Code answers related to "implement sharedpreferences in android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language