Answers for "kotlin shared preferences"

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
-2

sharedpreferences kotlin

val sharedPref = ""

        val sharedPreferences: SharedPreferences = this.getSharedPreferences(sharedPref,
            Context.MODE_PRIVATE)
Posted by: Guest on May-01-2021

Code answers related to "kotlin shared preferences"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language