Android意向电话号码

编程入门 行业动态 更新时间:2024-10-26 17:22:38
本文介绍了Android意向电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在TextView上有我的电话号码,并且想要打开意图选择器"以选择要使用的应用程序(Skype,Viber ...),或者只是拨号以进行调用.

I have my phone number at TextView and want to open "Intent-picker" to choose application that I want to call with(Skype, Viber...) or just dial to call it.

Intent callIntent = new Intent(Intent.ACTION_CALL);立即打来电话,对我没有帮助.

Intent callIntent = new Intent(Intent.ACTION_CALL); calls instantly so it doesn't help me.

推荐答案

我认为您正在寻找这样的东西:

I think you are looking for something like this:

Intent intent = new Intent(Intent.ACTION_DIAL); intent.setData(Uri.parse("tel:0123456789")); startActivity(intent);

这将打开拨号器(如果安装了多个可以拨打电话的应用程序,则会打开选择器对话框),但会实际填充该号码.有关更多信息,请参见此答案.

This opens the dialer (or creates a chooser dialog if there are multiple apps installed which can place a phone call) with the number filled in, but does not actually start the call. See this answer for more info.

更多推荐

Android意向电话号码

本文发布于:2023-10-27 22:36:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1534755.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:意向   电话号码   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!