如何在安卓中使用默认拨号器屏幕?

huangapple go评论54阅读模式
英文:

How to use default dialer screen in android?

问题

我正在为VoIP项目开发用户界面。我已经为拨号屏幕设计了界面。在Android项目中是否可以使用默认拨号屏幕?如果可以,请提供一个参考链接。

英文:

I am developing an UI for the voip project. I have designed a UI for the dialer screen. Is it possible to use default dialer screen in android project? If yes please provide a link to refer.

答案1

得分: 1

如果您想使用手机的默认拨号器,只需使用以下代码:

Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" + "1234567890"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

您必须在其中提到您想拨打电话的号码。它将打开默认的拨号器屏幕。

英文:

If you want to use default dialer of your phone just use below code

 Intent intent = new Intent(Intent.ACTION_DIAL);
 intent.setData(Uri.parse("tel:" + "1234567890"));
 intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 startActivity(intent);

You have to mention the number on which you want to place the call. It will open default dialer screen

huangapple
  • 本文由 发表于 2020年1月3日 17:39:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/59576157.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定