I am using an itemizedOverlay within my MapView that is generating waypoints. I have the ability to modify, add, delete these waypoints as desired. This MapView shares the screen as a fragment with a listView fragment. Currently the purpose of the fragment is to display the waypoints from the map and allow them to be deleted, moved, or whatever using the listFragment. All of this works as of right now.
The issue I have is that both fragments hold their own copy of the waypoint list. I.E. if I delete a waypoint using the mapview, the itemizedOverlay class must call the ListFragment function to remove a waypoint from its own list. This gets ugly and will have its own problems soon. It would be better to have a single list either in the listView, itemizedOverlay, or a separate class file.
In other applications (C++ or Java based), I have typically created another class as a singleton and it holds the information that would be shared between the map and listview. Is this still the best way to handle the issue when working with Android, or is there another better, built-in option to use?
You can use a single instance of your list if you hold a reference to a class that extends the Application
class of your project. See here for more information about this approach.