Use liveData.postValue(value) instead of liveData.value = value. It called asynchronous.
From documentation:
postValue – Posts a task to a main thread to set the given value.
Use liveData.postValue(value) instead of liveData.value = value. It called asynchronous.
From documentation:
postValue – Posts a task to a main thread to set the given value.