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

Wig Ari
Member
Joined: 2025-02-18 06:16:44
2025-02-18 06:33:17

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?