https://kotlinlang.org logo
#coroutines
Title
# coroutines
g

getabu

02/13/2020, 9:21 PM
I need help with since Coroutine never calls API after job either cancelled or pending. Details: https://stackoverflow.com/questions/60216513/coroutine-never-calls-api-after-job-either-cancelled-or-pending
m

mng

02/13/2020, 9:45 PM
You need to observe on the LiveData outside of the onClick. You’d want the view model to be a class level variable and just observe the LiveData after setContentView. your viewModel function should just make the api call and set the live data value on success
4 Views