How to show dialogue in mvvm android

showing a dialog, starting activity in MVVM is the responsibility of viewing.
you have a virtual machine instance, but in the virtual machine you do not have a view instance. therefore, the solution uses real-time data and monitors them, right?
but what about the time I don't want to use live data? How can I show the dialog when I do not have access to view?

+5
source share
1 answer

Using any version of the observer pattern is the only way! Even defining an interface and creating a view implements this interface mainly using an observer pattern. What is Java Observable, Rx Observable and LiveData, it simplifies this process.

0
source

Source: https://habr.com/ru/post/1269514/


All Articles