Question On Cache and retaining the observable
raghunandankavi2010 opened this issue · comments
I saw your video on Rx Java on youtube. From what i understand the observable needs to be retained during orientation change. One way to do that is in a retained fragment without ui.
I attended a talk on android organized By B.A.U.G. In the sample they used dagger, retrofit and EventBus. The point was to have model, view and presenter. In the example they use a singleton to retain the Observable and they use cache operator to cache the data. There is a problem if you do not have network connection your cache is empty and you go back to previous activity and come back you get the same empty cache.
I have been going through blogs, videos and i still don't understand how to handle it in a clear way.
Sample Project https://github.com/anupcowkur/MVPSample.
So how do i deal with this.
Sorry! if this is not the right place to raise the issue. I would be happy to put this in the right place. In fact i did ask this question on Rx java group and i haven't got an answer.
I seem to have stumbled on another github repository. AsyncSubject seems to be what i need. https://github.com/pmellaaho/RxApp