gpt4 book ai didi

android - 使用特定号码启动 Android 拨号器

转载 作者:行者123 更新时间:2023-11-29 22:17:56 24 4
gpt4 key购买 nike

我的代码运行良好,但它所做的只是启动拨号器。我想要它做的是能够启动具有特定号码的拨号器。我该怎么做?

bu5.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
//open the phone dialer on clicking the button
Intent intent = new Intent(Intent.ACTION_DIAL);
startActivity(intent);
}
});

最佳答案

您需要将带有号码的 tel: uri 设置到 intent 中,将其添加到 startActivity 行之前。

intent.setData(Uri.parse("tel:1231231234"));

关于android - 使用特定号码启动 Android 拨号器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8058733/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com