Android 2.1+ Pause for incoming/outgoing call, resume when done

前端 未结 1 1266
感情败类
感情败类 2021-01-28 16:37

Is there a reliable way in Android to detect the beginning and end of incoming and outgoing calls, in order to do things like pause and play audio.

I have done the follo

相关标签:
1条回答
  • 2021-01-28 17:23

    You are correct in that you don't get any state updates when a out going call is started.

    You need to hook into the intent broadcast ACTION_NEW_OUTGOING_CALL. Here is a Android Developer Blog that may help understand the fact that it's a ordered broadcast. And here is a blog post with a simple example of how to setup and use this broadcast.

    0 讨论(0)
提交回复
热议问题