当我运行这段代码时,为什么会出现这个句子(用于输入一个有效的数字)?
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + "#1234#"));
startActivity(intent);但是,如果您将数字从"#1234#"更改为"123456789",它工作正常,为什么(#)符号不被接受?
知道我加入了
<uses-permission android:name="android.permission.CALL_PHONE" />在AndroidManifest.xml中
注意:它仍然在低于安卓11的版本中工作,并且接受(#)符号,没有问题。
发布于 2021-12-09 16:52:15
你试过把"#“改为"%”吗?
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + Uri.encode("#1234#")));
startActivity(intent);这应该能解决你的问题。
https://stackoverflow.com/questions/70293339
复制相似问题