launching an activity from a broadcast receiver that listens to outgoing call

旧时模样 提交于 2019-12-03 14:04:20

In your manifest you require one permission (according to the docs):

You must hold the PROCESS_OUTGOING_CALLS permission to receive this Intent.

And that is

"android.permission.PROCESS_OUTGOING_CALLS"

Also straight from the docs:

Any BroadcastReceiver receiving this Intent must not abort the broadcast.

And here is the link to the page where I got the info:

http://developer.android.com/reference/android/content/Intent.html

Instead of aborting broadcast with abortBroadcast(); use setResultData(null) to end the call after launching your activity.

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