Search
 
SCRIPT & CODE EXAMPLE
 

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();
Comment

android sharedpreferences

SharedPreferences sharedPref = getSharedPreferences("name", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString("key", "Value");
editor.commit();
Comment

PREVIOUS NEXT
Code Example
Java :: java find last element in array 
Java :: java argument main 
Java :: java docstring javadoc 
Java :: java iterate over list 
Java :: dijkstra java 
Java :: how to make a string lowercase in java 
Java :: java split string 
Java :: get type java 
Java :: counting nodes in binary search tree 
Java :: how to convert int into int array of digits in java 
Java :: check whether a double is not a number in java 
Java :: java make all interfaces implement another 
Java :: java main method 
Java :: hide elements android 
Java :: how to read a excel file in java 
Java :: convert base64 to image png without saving 
Java :: int to byte 
Java :: hello world in different programming languages 
Java :: Java make numbers 
Java :: java does file exist 
Java :: java gridpane background color 
Java :: java localdate to calendar 
Java :: explicit casting 
Java :: get the max value from arrayList java and save it in int 
Java :: How to find the next greater permutation of a list of numbers, in Java? 
Java :: java remove last character 
Java :: java read next line 
Java :: How to efficiently convert a sorted array into a min height binary search tree, in Java? 
Java :: export java_home linux 
Java :: java regex 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =