我想打电话给*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);
}
}
我将telephoneNumber设置为*142#
,但仍拨打*142
。我该怎么做才能确保拨打*142#
?最后是#
?
答案 0 :(得分:1)
网址使用URLEncoder
对数字进行编码。
#
在URI语法中具有特殊含义,需要编码为%23
,以字面形式视为#
。