Created
January 23, 2020 15:53
-
-
Save Lavanyagaur22/2c6864ab4a6233341fd95422985bc09c 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 myObject = MyObject() | |
//set variables of 'myObject', etc.. | |
// val editor = prefs.edit() -> gives the SharedPreferences.Editor | |
val gson = Gson(); | |
val json = gson.toJson(myObject); | |
editor.putString("MyObject", json); | |
editor.apply(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment