In Xamarin, how can I get the autolink to work with some TextViews that are displayed inside a Google Map InfoWindow.
Here is my custom_info_window XML code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<TextView
android:id="@+id/Phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:autoLink="phone"/>
<TextView
android:id="@+id/Web"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:autoLink="web"/>
</LinearLayout>
Here is my InfoWindow class:
public class InfoWindow : Java.Lang.Object, GoogleMap.IInfoWindowAdapter
{
public View GetInfoContents(Marker p0)
{
var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;
View v = inflater.Inflate(Resource.Layout.custom_info_window, null);
TextView title = (TextView) v.FindViewById(Resource.Id.Phone);
title.Text = "Phone number: 0800 32 32 32";
TextView description = (TextView) v.FindViewById(Resource.Id.Web);
description.Text = "Email address: me@me.com";
return v;
}
public View GetInfoWindow(Marker p0)
{
return null;
}
}
When I click on a Marker, I show the InfoWindow, and it is correctly formatted as coded in the InfoWindow class.
However, when I click on either of the autolink items, the autolink does not work. A click on the InfoWindow only registers as a whole InfoWindow click, and does not separate into the two distinct TextViews.
Can I please have some help with this?
Thanks in advance