Is it possible to use Android's ViewModel and LiveData in a non-UI component (e.g., a Service)?

Wig Ari
Μέλος
που συμμετέχουν: 25 μέρες πριν
25 μέρες πριν

I want to manage UI-related data in a ViewModel and LiveData, but I'm working in a Service instead of an Activity. Is it possible to use these components outside of the UI thread, and if so, how?