Hacker News new | ask | show | jobs
by kllrnohj 3529 days ago
> As far as I know, there's no simple way to pass an object from the service to the UI.

They are in the same process, you can communicate between them through all the normal Java mechanisms. For example, your UI can just register & unregister a callback on the service directly in its start/stop methods (or in onVisibilityChanged if you'd rather do this in a View instead)

1 comments

Oh, that's better then. In documentation they always point you towards using complicated mechanisms for communication, but I suppose that only applies to services running in different processes. Thank you for the clarification.