【问题标题】:Disabling email,number detection in android WebView在 android WebView 中禁用电子邮件、号码检测
【发布时间】:2012-08-01 16:17:50
【问题描述】:

我正在使用phonegap+sencha touch2+android 开发一个应用程序。 我有一个面板显示包含电子邮件的各种内容,一些文本形式的数字。因为当我点击号码时它是一个 WebView,并且当我点击号码时,默认 MailCompose Activity 启动,Dialer Activity 启动。我怎样才能阻止这种情况发生。在加载 WebView 的 url 或 web 设置之前,我是否从 android 端缺少一些配置。或者来自 Phonegap 的东西,因为当我看到 log cat 它显示以下行 -

DroidGap.startActivityForResult(intent,-1)

【问题讨论】:

标签: cordova android-intent sencha-touch-2 android-webview android-websettings


【解决方案1】:

您应该能够将以下内容添加到 HTML 文档的 <head>

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

这应该适用于大多数 WebKit 浏览器,例如 Android、BlackBerry 和 iOS。

【讨论】:

  • 我从未尝试过这些标签,但您也应该可以将这些标签注入到您的 WebView 中的 HTML 页面中,这样您就不必更改相关页面。
猜你喜欢
  • 2012-03-10
  • 2019-01-27
  • 1970-01-01
  • 1970-01-01
  • 2021-12-25
  • 2012-10-25
  • 2014-04-25
  • 1970-01-01
  • 2020-01-01
相关资源
最近更新 更多