自动链接在地图无法正常工作无法正常、链接、地图、工作

2023-09-06 10:59:14 作者:长相思兮长相忆

我有以下TextView的在我的XML布局文件: -

I have the following TextView in my XML layout file:-

<TextView  
   android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:text="@string/autolink_test"
       android:autoLink="all"
/>

的字符串autolink_test包含一个电话号码,电子邮件地址,网站地址和物理地址的地理

The string autolink_test contains a phone number, an email address, a website address and a physical geographical address.

尽管前三被正确显示为可点击自动链接,地址没有。只有ZIP code部分显示为一个自动链接...这也为电话号码! (当我点击它时,电话拨号器启动时,这个数字)。

While the first three are showing up correctly as clickable autolinks, the address does not. Only the zipcode part shows up as an autolink... and that too as a phone number! (When I click it, the phone dialer starts up with that number).

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

OK,我想通了,是什么原因导致的问题。只是想我会离开这里的答案,以防别人运行到同样的问题。

OK, I figured out what was causing the problem. Just thought I will leave the answer here in case someone else runs into the same problem.

如果街道地址没有被正确大写,它是不正确读出的地址!

If the street address is not properly capitalized, it is not read properly as the address!

下面是我的XML autolink_test字符串:

Here is my XML autolink_test string:

<string name="autolink_test">Name: New York Times \n
   Email: public@nytimes.com \n
   Phone: 212-556-7652 \n
   Address: 620 Eighth Avenue New York, NY 10018  \n
   Address: 620 Eighth avenue New York, NY 10018  \n
   Website: http://www.nytimes.com
</string>

第一个地址正确显示为一个自动链接。 第二个(用小'A'的'大道')不正确显示。

The first address shows up correctly as an autolink. The second one (with a small 'a' in 'avenue') does not show up correctly.

这似乎有点怪我作为谷歌地图的网站肯定不会关心这些细微。

This seems a little strange to me as the google maps website certainly doesn't care about such niceties.

不管怎么说,所以这里是: - )

Anyways, so here it is :-)