I am working on establishing a two-way communication between an Activity and a service that runs in another process.
A process request from an Activity is not a big deal. But I want the process to notify Activity of events. The idea behind this is: the service runs regardless of the actual application. It periodically requests a web server. If a new task is detected on the web server, the process should notify you.
I found this thread on AndDev.org, but it doesn't seem to work for me. I fiddled with BroadcastReceiver. I implemented an interface that should notify about activity, but the problem is that the listener is always zero, since the translation from the process is performed through Intent, so the class that extends BroadcastReceiver will be re-created.
How to establish two-way communication? It should be possible. Thanks for any help,
Steff
android android-intent android-activity process service
stfn
source share