rx java - Prefetching network data with RxJava/Android -


i creating android events app uses rxjava wrap old network layer , cache setup observable.create(). i'm stumped how approach prefetching data though. display list of events open eventdetail activity fetch contents of given event. want prefetch of events' contents, end making redundant network calls if event selected before prefetch returns , caches. there way keep observables/subscriptions alive on activity switches? singleton network layer held in application? appreciated.

typically, keep logic away activities, so, "yes, definitely!": network layer need.

keeping approach, subscriptions stay alive if activity restarted, instance, on rotation. useful operator need .cache(), reuse ongoing network request instead of firing new 1 on new subscribe().


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

html - Outlook 2010 Anchor (url/address/link) -