Skip to content

Instantly share code, notes, and snippets.

@mitsinsar
Created March 7, 2020 12:54
Show Gist options
  • Save mitsinsar/29567fb66e4e4348dbe862ff0bb5266c to your computer and use it in GitHub Desktop.
Save mitsinsar/29567fb66e4e4348dbe862ff0bb5266c to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
private val service = RetrofitClient.getUniService()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
GlobalScope.launch(Dispatchers.IO) {
val result = service.getFoodList().data
val foodItems = Gson().fromJson(result, FoodItems::class.java)
Log.e("result", foodItems.items.toString())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment