gpt4 book ai didi

Android Intent.ACTION_CALL : phone number with # char

转载 作者:行者123 更新时间:2023-11-29 01:41:45 25 4
gpt4 key购买 nike

我想调用*142#

然而,它只拨*142#被忽略。

这是我的代码

Button button = (Button) findViewById(R.id.balance);

myButton.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View view)
{
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + telephoneNumber));
startActivity(intent);
}
}

我将电话号码设置为 *142# ,但它仍然调用 *142。我该怎么做才能确保它调用 *142# ?以 # 结尾?

最佳答案

URL 使用 URLEncoder 对数字进行编码。

# 在 URI 语法中有特殊含义,需要编码为 %23 才能按字面意思处理为 #

关于Android Intent.ACTION_CALL : phone number with # char,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24109943/

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