Search code examples
androidandroid-activityandroid-serviceandroid-service-binding

Can a service raise events that the calling activity subscribe to?


Specifically, we have two projects. The first calls the second via intent. The second starts a bound service that does bluetooth printing. We would like to have the service raise events that the first project's activity subscribes to. Is this possible? If so, how?


Solution

  • You can send a broadcast Intent to "publish" your event. The "subscriber" just needs to set up a listener to listen for the specific Intent.