title: How to make call from WebView with Intent
body: <p>My <code>WebView</code> contains a call button.On tapping the button, i get an error that says.</p>
  
  <blockquote>
    <p>webpage at tel : could not be loaded because net:err_unknown_url_scheme</p>
  </blockquote>
  
  <p>This is the code i used. I have used the inner class as suggested by other posts, but it still doesn't work.</p>
  
  <pre><code>public class WebActivity extends AppCompatActivity {
  
  private static final String TEL_PREFIX = "tel:";
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_web);
  
      WebView webb=(WebView)findViewById(R.id.web1);
      webb.getSettings().setJavaScriptEnabled(true);
      webb.getSettings().setSupportZoom(true);
      webb.setInitialScale(0);
      webb.setWebViewClient(new WebViewClient());
      webb.loadUrl("http://www.sitecart.in");
  
  
       class CustomWebViewClient extends WebViewClient {
  
          @Override
          public boolean shouldOverrideUrlLoading(WebView webb, String url) {
              url=webb.getUrl();
              if(url.startsWith(TEL_PREFIX)) {
                  Intent intent = new Intent(Intent.ACTION_DIAL);
                  intent.setData(Uri.parse(url));
                  startActivity(intent);
                  return true;
              }
              return false;
          }
      }
  
  
  
  }
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
  
      WebView webb=(WebView)findViewById(R.id.web1);
      if(event.getAction()==KeyEvent.ACTION_DOWN)
      {
  
          if (webb.canGoBack()){
  
              webb.goBack();
          }
          else {
  
              finish();
          }
          return true;
      }
      return super.onKeyDown(keyCode, event);
  }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9vWpv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9vWpv.png" alt="enter image description here"></a></p>