List data is to be displayed in a RecyclerView, and a graphical view at the same time. It is my understanding that separate adapters would be required for each.
My issue is
- I've been struggling with where to load persistent data and hold it at runtime.
- Loading and holding the data in separate adapters means loading the same data twice from persistent storage. Although some might be cached, it is still effectively loaded twice.
- How to trigger update of both views when the data is changed, say from an activity launched from click on the list view?
- The views should not need to know about the existence of each other.
Maybe the simple(?) solution is to wrap the list in a class, which handles the data loading, giving it an interface for listeners (the adapters) to subscribe to, and add the necessary listener interface, implementation, etc.
I don't mean this to be an opinion oriented question. There should be a common or best practice method. I'm new to android development.