开发者

How to solve this problem when an incoming call arrives?

开发者 https://www.devze.com 2023-01-31 23:49 出处:网络
I want BroadcastReceiver to rec开发者_运维知识库eive incoming call, so I used <receiver>--android.intent.action.ANSWER --</receiver>

I want BroadcastReceiver to rec开发者_运维知识库eive incoming call, so I used

<receiver>--android.intent.action.ANSWER --</receiver> 

in manifest file and my receiver class contains this code

if(intent.getAction().equals(Intent.ACTION_ANSWER)){}

but my receiver class doesn't receive any incoming call and does not response to me. How to solve this problem?

Thanks All


This action is not a receiver, but an activity one. You can't get receiver to receive the intent. See here. Use an activity instead.

See this example.

0

精彩评论

暂无评论...
验证码 换一张
取 消