Search code examples
cordovaandroid-intentsencha-touch-2android-webviewandroid-websettings

Disabling email,number detection in android WebView


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)


Solution

  • 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.