Skip to content

Instantly share code, notes, and snippets.

@Lavanyagaur22
Created January 23, 2020 15:57
Show Gist options
  • Save Lavanyagaur22/885aa52a443d47f20d36b5a220751bed to your computer and use it in GitHub Desktop.
Save Lavanyagaur22/885aa52a443d47f20d36b5a220751bed to your computer and use it in GitHub Desktop.
val json = prefs.getString("MyObject", "")
//returns the object of MyObject class that was saved earlier
val obj = gson.fromJson(json, MyObject::class.java)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment