Jul 16, 2022
The solution you provided is really bad, because you use android classes in VMs. With this strategy you'll end up with problems with testing, lifecycle, memory leaks and many more. VM should not have direct impact on any Android dependency. The easiest way to solve your case is to just emit event from VM that is handled in View/Fragment/whatever you use 🙂