简体   繁体   English

在Android 2.1中拨打紧急电话

[英]Making an emergency call in Android 2.1

Can I make an emergency call programmatically in Android 2.1? 我可以在Android 2.1中以编程方式拨打紧急电话吗?

I've tried to use something like this: 我试图用这样的东西:

Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(telUri));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_NO_USER_ACTION);
appCtx.startActivity(intent);

but the only thing that I can do is call the system dialpad with the specified emergency number. 但是我唯一能做的就是用指定的紧急号码呼叫系统拨号盘。

I have to push the 'dial' button to make call. 我必须按“拨号”按钮才能拨打电话。 Is there any way to skip the dialer? 有什么办法可以跳过拨号程序?

No, you can't. 不,你不能。 The phone activity (actually part of the Contacts application) is what responds to the ACTION_CALL intent and you can't change how it handles it. 电话活动(实际上是“联系人”应用程序的一部分)是对ACTION_CALL意图的响应,您无法更改其处理方式。 This is done specifically to make sure the user confirms the number he/she wishes to dial. 专门执行此操作以确保用户确认他/她希望拨打的号码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM