The hash key "#" lacks ussd code in the "tel:" links on html pages

Good afternoon. I have a simple link on a webpage where the user can call the USSD number:

<a href="tel:*111*2#" class="phoneCallButtonLink">*CLICK HERE AND CALL *111*2#</a>

it's pretty straightforward; Now, if I test it on a desktop browser, it issues a warning asking me if I want to call (via Skype) the number * 111 * 2 # , and this is normal.

with my Android phone (S Note 3), when testing this page, the phone (or something) deleted the last "#" (only the last) from the link, as a result of which call * 111 * 2 .

Has anyone experienced this? or knows how to prevent this?

+4
source share
4 answers

Use URL encoding for special character in UR L. For example, #equals%23

This worked for me:

<a ng-href="tel:%23 224">#224</a>

As you can see:

enter image description here

+5
source

You need to use for Uri.encode("#") exampleString number = "tel:*111*2" + Uri.encode("#");

+3
source

Try this way, hope it helps you solve your problem.

 webview = (WebView) findViewById(R.id.webview);
 webview.loadData("<a href=\"tel:*111*2#\" class=\"phoneCallButtonLink\">*CLICK HERE AND CALL *111*2#</a>","text/html", "utf-16");
 webview.setWebViewClient(new CustomWebViewClient());

 private class CustomWebViewClient extends WebViewClient {
    @Override
    public boolean shouldOverrideUrlLoading(WebView wv, String url) {
    if(url.startsWith("tel:")) {
       Intent intent = new Intent(Intent.ACTION_DIAL);
       intent.setData(Uri.parse(url.replace("#","%23")));
       startActivity(intent);
       return true;
    }
    return false;
   }
 }
+2
source

You can use below to display USSD in the dialog box

<a href="tel:*111*2%23" class="phoneCallButtonLink">*CLICK HERE AND CALL *111*2#</a>
0
source

All Articles