Answers for "4. sharedpreference is one of the ways to store data in android application"

-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 "4. sharedpreference is one of the ways to store data in android application"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language