【问题标题】:Android- Intent.ACTION_CALL is not working for phone no started with "911"Android- Intent.ACTION_CALL 不适用于以“911”开头的手机
【发布时间】:2021-10-15 20:20:13
【问题描述】:

以下代码运行良好除了那些以“911”开头的电话号码。它正在打开默认拨号器应用程序。

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

请注意,AndroidManifest.xml 文件中已经添加了一个ndroid.permission.CALL_PHONE。此外,这个应用程序在印度使用。

这背后有什么原因吗?

【问题讨论】:

    标签: android android-intent action phone-call


    【解决方案1】:

    引用the documentation for ACTION_CALL:

    注意:此 Intent 不能用于拨打紧急电话。但是,应用程序可以使用 ACTION_DIAL 拨打紧急号码。

    在美国,也许在其他地方,911 是一个紧急电话号码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-24
      • 2018-04-08
      • 1970-01-01
      相关资源
      最近更新 更多