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?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
what if use
android.intent.action.NEW_INCOMING_CALL
?When you reject incoming call,
callstate
changes from ringing to idle. This means you rejected.If call state changes from
OFFHOOK
to idle it means you answered a call.Hey. You could use the
PhoneStateListener
andCallLog
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
andandroid.intent.action.NEW_INCOMING_CALL
just putandroid.permission.PROCESS_INCOMING_CALLS
andandroid.permission.PROCESS_OUTGOING_CALLS
in your manifest.After a long time, Search and logic to solve this problem, I get the solution:
Problem: If i call a person, if my call is not accepted by the person,in my side i have to show a Toast is my call is rejected
Solution : Create a receiver which is register by two action
android.intent.action.NEW_OUTGOING_CALL android.intent.action.PHONE_STATE
Both action are necessary.
For this you have to take given permission
Manifast.xml
And your BroadcastReceiver class
*Call_Receiver.java*
This will show you a Toast when you call is not accepting.