I am using antroid:autoLink="map" attribute of TextView to Go to map and find the address associated with that textview.
But its is behaving stragely and finding only some addresses. Here is the code what I am trying:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textViewautoLink"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/autolinktext"
android:autoLink="map"></TextView>
</LinearLayout>
Here is my strings.xml
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="autolinktext">1600 Amphitheatre Parkway, Mountain View, CA 94043 </string>
</resources>
Issue is:
Suppose I am writing the above string i.e. 1600 Amphitheatre Parkway, Mountain View, CA 94043 then its working fine and textView gets blue in colour and when I click onit it searches the address on Map.
When I change this address to : 1600 Amphitheatre Parkway, Mumbai, IN then also it shows the same thing and tries to search the address but since the address is wrong it couldnt find it. Its OK.
But when I write other address like: 600 Band Stand, Mumbai, IN Then
1) the textview isnt in blue color
2) Its doesn't seem to be clickable
3) and since it is not clickable it doesn't find the address.
I am searching google but am not getting any reason for this behaviour. Also I want to know that
Is there any format for writing this map address?
Also how android knows that the address is valid or not by just writing the address in String as I have written the same address in the same format just changed the String and the result is that one address is clickable and other is not.
Please Help.
Below is the comment picked from the matcher
Source : CacheBuilder.cpp. For further info you could check the exact algorithm in CacheBuilder::FindPartialAddress of webviewcore
As far as i see from code only street names ending in LleY , NneX, RCade, VEnue, LAMEDA, aYoU and so on ... are matched. In your case Band stand does not match the street name ending that is common in US
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With