I have two fragments nested within another fragment. One is a list view, and one is a ViewPager, with the viewpager's content being details of a selected list view item. Obviously, they both use the same adapter. The contents of the adapter is refreshed every, say, 5 seconds, so I need to keep the adapter used by both fragments in sync.
What would be the best way to go about keeping the adapter in sync between the two fragments?
I was thinking of storing the adapter in a retained non-ui fragment, making all the update calls within this fragment. This would however require I constantly make pass the updated adapter to the child fragments and call notifyDataSetHasChanged
in each fragment