LifecycleOwner is currently needed in order for me to create an observer.
I have code which creates an Observer in the ViewModel so I attach the LifecycleOwner when
Assumptions:
Fuel
refers to your ViewModel
Fuel.request(IpAddressApi.MyIp())
is a method in your ViewModel
IpAddressApi.MyIp()
does not have a reference to your LifecycleOwner
, If all are true,then you are not violating it. So long as you are not passing a LifecycleOwner
reference to the ViewModel
you are safe!
LifecycleOwner - relates to an Activity or Fragment as it owns the various Android Lifecycles e.g onCreate, onPause, onDestroy etc