views:

100

answers:

2

Hi 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?

+1  A: 

When you want to notify your service you will need to call though to its process via AIDL.

Soulreaper
But I have to do this from an Activity right?The fact is that I have a PhoneStateListener listening for call state changes, and when some of this occur I want to notify my service.Is this possible?
LucaB
you would also be able to do this from your listener.
Soulreaper
How? I mean, in a Activity i can wrote:this.bindServiceBut I can't in a PhoneStateListener.
LucaB
+1  A: 

I'd think you'd be better off sending your service a broadcast intent than trying to bind to it.

Phil