Try this 

 TelephonyManager telephonyManager 
=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
        
  telephonyManager.listen(new MyPhonestateListener(), 
PhoneStateListener.LISTEN_CALL_STATE);

private class MyPhonestateListener extends PhoneStateListener
    {
        
        @Override
        public void onCallStateChanged(int state, String incomingNumber) 
        {
            super.onCallStateChanged(state, incomingNumber);
            
            switch (state) 
            {
            case TelephonyManager.CALL_STATE_IDLE:

                break;

            case TelephonyManager.CALL_STATE_OFFHOOK:

                break;

            case TelephonyManager.CALL_STATE_RINGING:

                break;
            default:
                break;
            }
            
            
        }

may you get some help

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

Reply via email to