I am building an Android app following a similar design pattern to the Field service sample app but I can't figure out a best practice to share instances of my viewmodels between activities and fragments.
I currently have a static viewmodel locator class which resolves a view model to only one instance. But it is not suggested to keep static instances in memory considering how android can kill an activity at any time.
Is there any tips on how to do this better?