Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何阻止外出通话?_Android_Android Emulator - Fatal编程技术网

Android 如何阻止外出通话?

Android 如何阻止外出通话?,android,android-emulator,Android,Android Emulator,我正在使用以下代码阻止来电 { telephonyService = (ITelephony) method.invoke(telephonyManager); telephonyService.silenceRinger(); telephonyService.endCall(); } 但我想知道如何阻止外出通话 <receiver android:name="MyPhoneReceiver"> <intent-fil

我正在使用以下代码阻止来电

{
     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>
有了这个你就可以得到这个号码了


查看此项以阻止呼叫检查达曼达尔回答建议。查找固定拨号设置。@lucifer我需要编程设置,因此,搜索使用代码激活固定拨号的代码Hi venkat给你最主要的接收器代码我这样写,但它不工作代码有什么问题吗?我知道如何获得号码,但我不知道如何阻止itcheck检查我为bloacking callin提供的链接,只有他们编写的代码只用于查找传出呼叫。。我需要知道如何停止外呼
@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);
}