Here's my ViewModel
class MainViewModel(repository: MainActivityRepo) : ViewModel() {
val isLoading: MutableLiveData<Boolean> = MutableLiveData()
init {
isLoading.value = false
android.os.Handler().postDelayed({
isLoading.value = true
Timber.d("isCalled")
}, 5000L)
}
}
I debugged and checked and the log is working perfectly.
The first value of boolean is set correctly, while the second is not