Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

calllog - Is it possible to detect rejected calls in Android?

In my application, it would be nice to intercept when the user rejects a call, i.e. choose to send busy tone. Is there any way, besides being notified when there is an incoming call, to do this? I have not found anything in the docs regarding this. Is this information stored in the call log, i.e. can I poll the call log to see if a call was rejected or answered?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Hey. You could use the PhoneStateListener and CallLog classes to query the recent calls list to find rejected calls.

http://developer.android.com/reference/android/provider/CallLog.html http://developer.android.com/reference/android/telephony/PhoneStateListener.html

Alternatively you can monitor broadcasts on android.intent.action.NEW_OUTGOING_CALL and android.intent.action.NEW_INCOMING_CALL just put android.permission.PROCESS_INCOMING_CALLS and android.permission.PROCESS_OUTGOING_CALLS in your manifest.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...