Reputation: 3
I'm able to add location markers on a map when the Activity is in the foreground, but how do you keep placing markers on the map when the Activity is moved to the background (ie user pressed home button). I still want to update the UI by adding location markers to map Activity even though it's not visible so when user goes back to Activity, the location markers show where the user was even though Activity was in background.
I saw examples updating foreground Activity from background service, but didn't see examples updating background Activity from background service. Thanks for your help.
Upvotes: 0
Views: 471
Reputation: 18440
Since the activity in the background nothing will be displayed anyways, so all what you need is to keep track of the markers
and in the activity onResume
get the updated list of markers and show them on the map when the activity is moving to foreground
state.
Upvotes: 1