Mark McDonald
Mark McDonald

Reputation: 8190

How can I link to a phone call link from within an embedded web page in Android?

I have an Android application that has one section loading a web page within a frame of the app.

On the webpage, it has a link to call our support line using the tel:123456 protocol (i.e. <a href="tel:123456"><img/></a>) and that works exactly as expected within the native Android browser.

However, when the app loads the embedded page (using a WebView) and I click the tel: link, I get the "Web page not available" screen ("The Web page at tel:123456 might be temporarily down or it may...").

I assume I need to handle the protocol in the app somehow but I'm not sure how. What do I need to do?

Upvotes: 0

Views: 1299

Answers (1)

Yuvi
Yuvi

Reputation: 1350

Hi you have to manually handle this, you have to add WebViewClient to your webpage and then you have to override shouldOverrideUrlLoading see here and then you have to extract phone number from url then fire intent for phone call, Hope this help...

Upvotes: 1

Related Questions