How to handle incoming call events in Android

孤人 提交于 2020-01-14 04:23:10

问题


Does anybody know if there is any event to handle incoming calls?
I'm developing an app that streams audio from the microphone and I would like to have a listener that stops the recording, etc when there is an incoming call, and that restarts the process when the telephone call is over.


回答1:


You can create a BroadcastReceiver and listen for the TelephonyManager#ACTION_PHONE_STATE_CHANGED action.



来源:https://stackoverflow.com/questions/3137582/how-to-handle-incoming-call-events-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!