在包含hash#sign的Android中发送ACTION_CALL Intent

GZA*_*GZA 8 android android-intent

我遇到了哈希符号被截断的问题.有人知道解决方案吗?使用unicode或%23在我的情况下不起作用.现在拨打的号码是*101

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

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

Intent intent;
intent = new Intent(Intent.ACTION_CALL, Uri.parse(uri));
Run Code Online (Sandbox Code Playgroud)

GZA*_*GZA 16

找到了解决方案:String encodedHash = Uri.encode("#"); 这样做了......


小智 11

我通过替换#in%23找到了解决这个问题的方法

String uri = "tel:" + "*133%23";

Intent intent;
intent = new Intent(Intent.ACTION_CALL, Uri.parse(uri));
Run Code Online (Sandbox Code Playgroud)