繁体   English   中英

Android Intent.ACTION_CALL:带#个字符的电话号码

[英]Android Intent.ACTION_CALL: phone number with # char

我想拨打*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 我该怎么做才能确保拨打*142# #结尾?

URL使用URLEncoder编码数字。

#在URI语法中具有特殊含义,需要将其编码为%23 ,以字面意义将其视为#

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM