Skip to content

Instantly share code, notes, and snippets.

@akuholla
Last active May 6, 2022 17:19
Show Gist options
  • Save akuholla/ea2f1c0ebdac760831d29549f1c344cb to your computer and use it in GitHub Desktop.
Save akuholla/ea2f1c0ebdac760831d29549f1c344cb to your computer and use it in GitHub Desktop.
Gson
dependencies {
implementation 'com.google.code.gson:gson:2.9.0'
}
val countryArrayType: Type = object : TypeToken<ArrayList<Country?>?>() {}.type
val outputList: ArrayList<Country> = Gson().fromJson(countriesString, countryArrayType)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment