如何在android中以编程方式拒绝来电
在我的应用程序中,我将维护一个联系人列表。
列表中联系人的所有来电都将被挂断。它们会显示在未接来电下,但电话不会响铃。
In my app I will maintain a list of contacts.
Any calls from contacts in the list will be dropped. They will show under missed calls but the phone will not ring.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先创建此接口:
然后创建扩展 BroadcastReceiver 的类
这只会阻止该单个电话号码,但您明白了。
在您的清单中添加以下内容:
First create this Interface:
Then Create this class that extends BroadcastReceiver
This will only block that single phonenumber, but you get the point.
In your manifest add this:
从 此处。
然后将其放入
com.android.internal.telephony的包中(新建一个包)。
然后将包导入到适当的类中,并使用
endCall()
方法拒绝调用Download the class of ITelephony from here.
Then put it in a package (make a new package) of
com.android.internal.telephony.
Then import the package to the appropriate class and for rejecting a call use the
endCall()
method