android – 如何阻止外出通话?

android – 如何阻止外出通话?,第1张

概述我使用以下代码阻止来电, { telephonyService = (ITelephony) method.invoke(telephonyManager); telephonyService.silenceRinger(); telephonyService.endCall();} 但我想知道如何阻止外出通话? <receiver android:name="My 我使用以下代码阻止来电,

{     telephonyService = (ITelephony) method.invoke(telephonyManager);     telephonyService.silenceRinger();     telephonyService.endCall();}

但我想知道如何阻止外出通话?

解决方法
<receiver androID:name="MyPhoneReceiver">            <intent-filter androID:priority="100">                <action androID:name="androID.intent.action.PHONE_STATE"></action>                <action androID:name="androID.intent.action.NEW_OUTGOING_CALL"></action>            </intent-filter>        </receiver>

并在你的广播记录中

@OverrIDe    public voID onReceive(Context context,Intent intent) {      TelephonyManager telephony = (TelephonyManager)  context.getSystemService(Context.TELEPHONY_SERVICE);CustomPhonestateListener customPhoneListener = new CustomPhonestateListener (context);telephony.Listen(customPhoneListener,PhonestateListener.ListEN_CALL_STATE);}

有这个你可以得到数字

看到这个阻止拨打How to Block outgoing calls and Text SMS检查dharmendar的答案

总结

以上是内存溢出为你收集整理的android – 如何阻止外出通话?全部内容,希望文章能够帮你解决android – 如何阻止外出通话?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1127078.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存