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