Android中如何处理来电事件
有人知道是否有任何事件可以处理来电吗?
我正在开发一个从麦克风传输音频的应用程序,我希望有一个监听器,可以在有来电时停止录音等,并在电话结束时重新启动该过程。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个
BroadcastReceiver
并监听TelephonyManager#ACTION_PHONE_STATE_CHANGED
操作。You can create a
BroadcastReceiver
and listen for theTelephonyManager#ACTION_PHONE_STATE_CHANGED
action.