I have a MapActivity that runs a Runnable that blips the map with the user's location. Over time this will create a path to show where the user has been. I also have an ongoing notification running so the user has the ability to reopen the map to see the current path, after navigating through the OS (music, browser, contacts...) if they need to do so.
My problem is that over time if the user clicks the ongoing notification to return to the MapActivity it creates a new map, which deletes all the blips that were there. The Pending Intent is created from the same Intent initially called to create the Map Activity, and it has the launchmode set to singleInstance.
I can't wrap my head around what is happening, other than it is not working correctly. Is the stack being messed with and then when the user brings the Map Activity to the front the stack can't find the original Map Activity, or is it something else that I am missing? Should I somehow have the blip function run in a Service to run in the background? (How would I do that, and would that retain the state of the overlays on the map the way I want?)