Android Question Raise event from a service to running activity (if any)

klarsys

Active Member
Licensed User
Longtime User
I have one app that has multiple activities and any one of them can be active at a time.

I have a background service that starts at boot and keeps looking for some state changes. Now, whenever there is a state change, I want to raise an event from the service and I want then active activity to receive that event.

One way I think I can do it is check IsPaused for all activities and use CallSubDelayed for running one (if any).

Is there a better way to achieve this?
 
Top