--

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 🙂

--

--

Patryk Kosieradzki
Patryk Kosieradzki

Written by Patryk Kosieradzki

Senior Android &iOS Engineer @ Moss, based in Warsaw, Poland

Responses (1)