发送ACTION_CALL意图在Android中包含的哈希#号意图、ACTION_CALL、Android

2023-09-06 14:47:44 作者:深情似海╮

我有该井号被截断的问题。是否有人知道一个解决方案吗?使用UNI code或23%,不工作在我的情况。现在正在拨打的号码是* 101

 字符串的uri =电话:+* 101#;

//字符串URI =电话:+* 101 \ u0023;

意向意图;
意图=新的意图(Intent.ACTION_CALL,Uri.parse(URI));
 

解决方案

找到了解决办法:字符串连接codedHash = Uri.en code(#);这样做有...

I am having the problem that the hash sign is truncated. Does anybody know a solution? using unicode or %23 is not working in my case. Now the number that is dialed is *101

String uri = "tel:" + "*101#";

//String uri = "tel:" + "*101\u0023";

Intent intent;
intent = new Intent(Intent.ACTION_CALL, Uri.parse(uri));
Android中的Activity通过显式意图传值

解决方案

Found a solution: String encodedHash = Uri.encode("#"); this did the trick...