Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/359.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/190.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.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
Java 如何在Android中使用本机dailer应用程序直接拨号_Java_Android_Android Intent - Fatal编程技术网

Java 如何在Android中使用本机dailer应用程序直接拨号

Java 如何在Android中使用本机dailer应用程序直接拨号,java,android,android-intent,Java,Android,Android Intent,在我的应用程序中,我需要拨一些电话号码。但是当我试着这样做的时候,下面的图片提示就来了。我怎样才能避免这种情况?我只需要使用本机拨号器应用程序拨号 我调用“phoneNo”的代码是 Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:" + phoneNo)); startActivity(callIntent); 我想你需要做一些对我有用的事情 I

在我的应用程序中,我需要拨一些电话号码。但是当我试着这样做的时候,下面的图片提示就来了。我怎样才能避免这种情况?我只需要使用本机拨号器应用程序拨号

我调用“phoneNo”的代码是

    Intent callIntent = new Intent(Intent.ACTION_CALL);
    callIntent.setData(Uri.parse("tel:" + phoneNo));
    startActivity(callIntent);

我想你需要做一些对我有用的事情

Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:" + phoneNo));
startActivity(callIntent);
行动电话:

Activity Action: Dial a number as specified by the data. This shows a UI with 
the number being dialed, allowing the user to explicitly initiate the call. 
希望对你有帮助

好的,我得到了这个答案

根据API,ACTION_CALL将执行您需要的操作,但不会拨打紧急电话号码,而ACTION_DIAL将显示带有拨号提示的拨号器,但允许拨打紧急电话号码

我恐怕没有办法去做你想做的事情,因为有一个很好的理由——防止误拨紧急服务。这是一项预防措施

从这里


好的,我认为对于你想要执行的操作,你应该在你的手机中至少有一个默认拨号器。请检查。

如何调用屏幕截图等?请让我看看你的意图。对不起…我现在已经添加了我的意图..不,它直接呼叫号码Action\u拨号仅显示拨号盘。。不打电话。。我想正如你所说,我们不能这样做(实际上,如果用户选择了默认拨号程序,则ACTION_CALL会执行您想要的操作。否则,用户会选择他/她想要的。