Answers for "Do I have to start new Thread when I wan to save data t5o SharedPreference"

4

android sharedpreferences

SharedPreferences sharedPref = getSharedPreferences("name", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString("key", "Value");
editor.commit();
Posted by: Guest on November-07-2020
-1

store data in sharedpreferences android

// MY_PREFS_NAME - a static String variable like: 
//public static final String MY_PREFS_NAME = "MyPrefsFile";
SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();
 editor.putString("name", "Elena");
 editor.putInt("idName", 12);
 editor.apply();
Posted by: Guest on November-04-2020

Code answers related to "Do I have to start new Thread when I wan to save data t5o SharedPreference"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language