I would like to know if there is the possibility that my APP can notice when I clicked the red button (accidentally or not) to end a call. I have an APP running in background that can track the incoming number of the phone at the moment that I receive a call and while doing the call.
As the "red button" to end a call is not a hardware button in the touch screen phones, I'm struggling trying to know how to detect when I pressed that button. And I'm starting to think that is not really possible.
I have searched and I found that there are ways to know the position that your fingers are touching in the screen while running your APP, (I don't know if this is possible when your APP is running in background) but as every android phone has a different shape and form of hanging up a phone call this is not a possible solution for my problem.
preguntado el 09 de marzo de 12 a las 13:03
You can find out when the user hangs up a phone by implementing a BroadCast Receiver listening to phone state. When the state becomes Idle after either ringing state or offhook state, you can get to know the call has ended. If you just want to know when the call ends this method would work fine.