Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by Martyn for Can I make a phone call from HTML on Android?

I have just written an app which can make a call from a web page - I don't know if this is any use to you, but I include anyway:

in your onCreate you'll need to use a webview and assign a WebViewClient, as below:

browser = (WebView) findViewById(R.id.webkit);browser.setWebViewClient(new InternalWebViewClient());

then handle the click on a phone number like this:

private class InternalWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {         if (url.indexOf("tel:") > -1) {            startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse(url)));            return true;        } else {            return false;        }    }}

Let me know if you need more pointers.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>