Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.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 我想在ACTION#u call的帮助下通过按下手机应用程序中的按钮拨打紧急电话号码,但我没有';T为什么?_Java_Android - Fatal编程技术网

Java 我想在ACTION#u call的帮助下通过按下手机应用程序中的按钮拨打紧急电话号码,但我没有';T为什么?

Java 我想在ACTION#u call的帮助下通过按下手机应用程序中的按钮拨打紧急电话号码,但我没有';T为什么?,java,android,Java,Android,我想在ACTION_call的帮助下通过按下手机应用程序中的按钮拨打紧急电话,但我没有。为什么? 我在清单文件中实现了呼叫电话权限 <uses-permission android:name="android.permission.CALL_PHONE"/> 这个代码把我带到手机的默认拨号器上 我怎样才能在不使用默认拨号器的情况下直接用我的应用程序拨打紧急电话号码?日志上写着什么-java.lang.StackOverflower错误:堆栈大小8192KB,点击按钮后,我会进入手机

我想在ACTION_call的帮助下通过按下手机应用程序中的按钮拨打紧急电话,但我没有。为什么?

我在清单文件中实现了呼叫电话权限

<uses-permission android:name="android.permission.CALL_PHONE"/>
这个代码把我带到手机的默认拨号器上


我怎样才能在不使用默认拨号器的情况下直接用我的应用程序拨打紧急电话号码?

日志上写着什么-java.lang.StackOverflower错误:堆栈大小8192KB,点击按钮后,我会进入手机的默认拨号器。嗨。。我已经用它更新了我的答案检查。。。如果108是你所在地区的紧急电话号码,那么只有它会打电话。
 Intent callIntent = new Intent(Intent.ACTION_CALL);
    callIntent.setData(Uri.parse("tel:"+123));//change the number

    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CALL_PHONE},12);
    }else{
        startActivity(callIntent);
    }
 Intent callIntent = new Intent(Intent.ACTION_CALL);
    callIntent.setData(Uri.parse("tel:"+123));//change the number

    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CALL_PHONE},12);
    }else{
        startActivity(callIntent);
    }