开发者

How to solve this problem when an incoming call arrives?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜