Disabling email,number detection in android WebView
Asked Answered
E

1

2

I'm developing an app with phonegap+sencha touch2+android. I've one panel showing various content that contains emails, some numbers in textual form. As it's a WebView when I tap on number, andorids default MailCompose Activity starts, when I tap on number Dialer Activity starts. How can I disable this from happening. Is there some config I'm missing from android side before loading url or web settings for WebView. Or something from Phonegap because when I saw log cat it shows following line -

DroidGap.startActivityForResult(intent,-1)

Edgeworth answered 3/8, 2012 at 15:27 Comment(1)
possible duplicate of #5473047, #7772187, #3189383Kylie
L
13

You should be able to add the following to the <head> of your HTML document.

<head>
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
</head>

This should work on most WebKit browsers, such as Android, BlackBerry, and iOS.

Liverpool answered 3/8, 2012 at 17:34 Comment(1)
I have never tried these tags, but it should also be possible for you to inject these into the HTML page in your WebView so that you don't have to change the pages in question.Annual

© 2022 - 2024 — McMap. All rights reserved.