android 如何获取紧急电话号码
我看到有很多关于如何拨打号码的示例,而且我还看到我只能弹出拨号器才能拨打紧急号码。但在所有这些示例中,他们将“911”硬编码为要使用的号码。嗯,这在美国工作得很好,但由于 Android 手机在其他国家/地区销售,因此我的应用程序有可能会被不在美国的人购买,或者居住在美国的人可能会将手机带到海外;有没有办法让我的应用程序意识到它不在美国,因此必须使用不同的号码来呼叫紧急服务,该号码是什么?
总而言之,我想知道是否有一种方法可以让应用程序在拨号器中显示其所在国家/地区的紧急号码,而无需在编译时知道该号码?
I see there are plenty of examples on how to call a number, and I also see that I can only have it pop up the dialer to go to an emergency number. But in all those example they hard coded "911" as the number to use. well this works fine in the US but since android phones are sold in other countries and thusly there is the possibility that my app will be bought by someone not in the US, or that someone who lives in the us may take their phone overseas; is there a way then my app can realize it's not in the us and thusly has to use a different number to call emergency service and what that number would be?
So to sum up I'd like to know if there is a way I can have it so when the app goes to bring up the dialer with the emergency number for the country it's in, with out having to know that number at complie time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 PhoneNumberUtils.isEmergencyNumber():
号码将是逗号分隔的列表。
According to the source for PhoneNumberUtils.isEmergencyNumber():
numbers will be a comma separated list.