How do I know if the user disconnected the call?

MrKim

Well-Known Member
Licensed User
Longtime User
I have been trying to solve this for 2 weeks. The good news my efforts led me to Basic4android so now I am at least working in a language I know. Thank you!

The issue: I need to know that it was the user who disconnected a call. Phonestate changed doesn't distinguish. I get:
State: IDLE, Phone#: 345
If the user declines the call OR if the caller hangs up. So I have no way of knowing if it was a missed call.
The event log shows:
DISCONNECT
- onDisconnect: cause = INCOMING_REJECTED, incoming = true, date = 1347920261683

HOW CAN I TRAP THAT??!!

Or barring that I would simply like the answer to my other question. How can I detect if there has been ANY user input. Keypress, screen, etc. I have trapped "UserPresent" which is great but what I really need to know is if the user has pushed any buttons mouse, trackball, etc. I am aware there is probably no one event for any of these but I can't seem to find a way to hook any of them, particularly the screen.

Thanks for any help.
Kim
 

MrKim

Well-Known Member
Licensed User
Longtime User
Have you checked whether this information is available in the passed intent? Use Log(Intent.ExtrasToString).

Yes, it appears to just contain the State and IncomingNumber. Like I said, I have spent the last week or two on my own trying to figure this out. I am hoping someone KNOWS how to do this.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
The way I solved it.

I never could find a really clean way to resolve this so what I did was:

Phone rings: Capture the LAST Phone log entry.
OFFHOOK: I'm done I don't care.
IDLE:Read the last phone log entry and see if it was a missed call and that it is AFTER the one I captured.

Ugly, but it seems to work.

I REALLY wish there was a low level way to read ANY keystroke/screen touch. I don't really care what it is, I just want to know if the user is THERE.
 
Upvote 0
Top