如何处理在Android的来电事件 [英] how to handle incoming call events in Android
本文介绍了如何处理在Android的来电事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有谁知道是否有任何事件来处理来电?我正在开发一个应用程序,流来自麦克风的音频,我想有一个侦听器,停止记录,等当有来电...那重启procress当电话呼叫结束。
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 procress when the telephone call is over.
推荐答案
您可以创建一个的BroadcastReceiver
,并听取了<一href="http://developer.android.com/reference/android/telephony/TelephonyManager.html#ACTION_PHONE_STATE_CHANGED"相对=nofollow> TelephonyManager#ACTION_PHONE_STATE_CHANGED
行动。
You can create a BroadcastReceiver
and listen for the TelephonyManager#ACTION_PHONE_STATE_CHANGED
action.
这篇关于如何处理在Android的来电事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文