LiveData observer not getting triggered in Kotlin
I am using LiveData with Kotlin in my project.
I have been facing an intermittent issue wherein the Observer attached to a MutableLiveData object is sometimes not getting triggered.
The Observer is attached in the activity onCreate(), (with the Activity as the Lifecycle Owner) over the LiveData object in the ViewModel.
ViewModel instantiation:
mViewModel = ViewModelProviders.of(this).get(MyViewModel::class.java)
Setting the observer:
mViewModel.mGoogleDirectionResponse.observe(this,...