Skip to content

Instantly share code, notes, and snippets.

@luiszacheu
Created October 28, 2019 18:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luiszacheu/cd1aa1f431c421294bd937d233f06fb7 to your computer and use it in GitHub Desktop.
Save luiszacheu/cd1aa1f431c421294bd937d233f06fb7 to your computer and use it in GitHub Desktop.
Gson FromJson List (Kotlin)
val gson = Gson()
val jsonString = gson.toJson(list)
val listType = object : TypeToken<List<String>>() { }.type
val newList = gson.fromJson<List<String>>(jsonString, listType)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment