开发者

Android WebView : disable geo: for addresses

开发者 https://www.devze.com 2023-03-28 03:44 出处:网络
In my Android application, I am using a WebView to render a list of locations. For some reason, when I click on a list item, it interprets it as a \"geo:\" address and opens the default browser to sho

In my Android application, I am using a WebView to render a list of locations. For some reason, when I click on a list item, it interprets it as a "geo:" address and opens the default browser to show the location. How can I configure the WebView to not interprete the location's addresses.

I don't want the "geo:" handling to swallow the "normal" list item touch event. If I tap carefully just on the location name then the "normal" list item touch event is fired. The WevView must interprete addresses automatically, since I don't add the "geo:" markup.

Sample content:

Southport Open Storage
3080 Promenade St, West Sacramento, CA 95691, USA

Sample content html:

<li class="ui-li ui-li-static ui-body-c">
 <span class="location-address-name">D And L Heating And Air - HVAC Contractor</span><br>
 <span class="location-formatted-address">3236 开发者_开发问答Malcolm Island St, West Sacramento, CA 95691, USA</span>
</li>

Additional Info:

  • Using jQueryMobile 1.0-b2 to for all UI components
  • jQuery 1.6.2

Android WebView : disable geo: for addresses

I saw some posts about "geo:" but they mostly dealt with WebViewClient.shouldOverrideUrlLoading(...) which seems no relevant to the above issue.


Looks like you want to add this to your <head>:

<meta name="format-detection" content="address=no" />

See also this similar question:

  • Disable the automatic Linkify of Webview
0

精彩评论

暂无评论...
验证码 换一张
取 消