Mutable Live data is triggering only once even after the value is set

129 Views Asked by At

Mutable Live data is triggering only once. I have a singleton class in which an instance of mutable live data is created once and I am calling a retrofit to get some response inside the singleton method the response is set to Mutable Live data and the observer is set in the second activity. I am calling a retrofit method from the first activity and navigating to the second activity in which Mutable Live data is observed. First time live data is triggered after getting the response from the retrofit. After getting the observer callback I am navigating to the first activity on back click and finish the second activity. Now-Again From the first activity I am calling the retrofit method of singleton class and navigating to the second activity and observing the mutable Live data but after the successful response from retrofit setting the value to mutable live data is not triggering any call to the second activity which is observing the mutable live data which has active observers. How to get the observer callback in the second activity after the Mutable live data value is set the second time?

0

There are 0 best solutions below