Created
July 4, 2022 12:15
-
-
Save wajahatkarim3/77dd770de8d625165b257c3079d3dab0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val preferences = this.getSharedPreferences("SOME_NAME", Context.MODE_PRIVATE) | |
// Get the Editor of SharedPreferences | |
val editor = preferences.edit() | |
// Save values through put*() methods | |
editor.putString("myStrKey", “Some String Value Goes Here”) | |
editor.putLong("myLongKey", 12L) | |
editor.putInt("myIntKey", 10) | |
editor.putDouble("myDoubleKey", 2.0) | |
// Save the above values in Preferences | |
editor.apply() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment