Notify a service from a PhoneStateListener
-
21-09-2019 - |
Question
I have built an application that listen to call state changes, and I want to notify a service when the call_state became IDLE.
All the components I have are functional, I just need to notify (not start) a service for this.
What's the correct practice, maybe using AIDL?
Because, in a PhoneStateListener, I can't bind to a service. Do I have to start an activity for that?
Solution
I'd think you'd be better off sending your service a broadcast intent than trying to bind to it.
OTHER TIPS
When you want to notify your service you will need to call though to its process via AIDL.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow