bluebox
bluebox

Reputation: 3

How do I update activity UI that is running in background from a background service?

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

Answers (1)

iTech
iTech

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

Related Questions