// i have a service (that extends Service).

public class MyService extends Service {
    private TelephonyManager telMgr;

    // i have a private inner class that extends PhoneStateListener.

    private class MyPhoneStateListener extends PhoneStateListener {
        @Override
        public void onCallStateChanged(int state, String
incomingNumber) {
            ....
        }
    }

    @Override
    public void onCreate() {
        super.onCreate();

        // in my onCreate method, I setup the listen
        telMgr = (TelephonyManager) getSystemService
( TELEPHONY_SERVICE );
        telMgr.listen( new MyPhoneStateListener(),
TelephonyManager.CALL_STATE_OFFHOOK |
TelephonyManager.CALL_STATE_RINGING |
TelephonyManager.CALL_STATE_IDLE );

    }
}

// I then connect the phone to my debugger and run the service.  I set
a breakpoint in the onCallStateChanged() and then call my phone -- I
never trigger the breakpoint and so I'm never going into
onCallStateChanged.

Am I missing something?  Can I do this from a service?

tia.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to