Observe LiveData from foreground service
I used ViewModel with LiveData in LifecycleActivity and Fragments it works and observes data as expected. Coming to your problem, when you create new ViewModel from Service or any another Activity it creates new instance of all the LiveData and other dependencies required for ViewModel to query from Repository and ultimately DAO. If you are … Read more