0

I was wondering to intercept the keycode thats get fired when user swipes the green circle towards the other edge of the screen to answer any call.
As far as i know every activity and view is allowed to intercept all the keys pressed like the back key or the home key.

It would be nice to know whether a service is able to intercept the same thing by implementing the onkeylistener interface.

Thanks in advance.

nunofmendes
  • 3,731
  • 2
  • 32
  • 42
  • what makes you think it is a keycode? I'd say it is more something for an `ontouchlistener`? – Nanne Nov 04 '14 at 14:11
  • If its something related to ontouchlistener then it would be nice to know if a service is able to listen for it or not.If not then please tell me if activity that is created by the android to show the incoming calls is able to listen for the same. – Mohit Wadhwani Nov 04 '14 at 14:26

1 Answers1

2

It is not possible to intercept the actual keypress. You can however user the TelephonyManager to listen for call state changes.

For an example you might see Tahlas answer to how to add a PhoneStateListener.

Community
  • 1
  • 1
mach
  • 8,315
  • 3
  • 33
  • 51
  • Thanks for your answer mach but i am aware of the functionality of the telephonymanger.I was eager to know the kind of the action that gets fired when user swipes to receive or disconnect the call. – Mohit Wadhwani Nov 04 '14 at 14:29