Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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();
Source by developer.android.com #
 
PREVIOUS NEXT
Tagged: #android #sharedpreferences
ADD COMMENT
Topic
Name
8+9 =