Created
October 28, 2019 18:44
-
-
Save luiszacheu/cd1aa1f431c421294bd937d233f06fb7 to your computer and use it in GitHub Desktop.
Gson FromJson List (Kotlin)
This file contains 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 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