【发布时间】:2015-04-02 12:59:37
【问题描述】:
我在 Google 地图上显示了几个标记。 当我点击一个标记时,它会打开一个自定义 InfoWindowAdapter
this.map.setInfoWindowAdapter(new CustomInfoWindowAdapter(getLayoutInflater()));
在这个 CustomInfoWindowAdapter 中,我会显示一些文本并在找到电话号码时创建一个链接:
@Override
public View getInfoContents(Marker marker) {
if (this.popup == null) {
this.popup = inflater.inflate(R.layout.poi_marker, null);
}
TextView tv = (TextView) popup.findViewById(R.id.title);
tv.setText(marker.getTitle());
tv = (TextView) popup.findViewById(R.id.snippet);
tv.setText(marker.getSnippet());
Linkify.addLinks(tv, Linkify.PHONE_NUMBERS);
return(popup);
}
然后显示是正确的。我可以看到电话号码显示为链接,但我无法按下它... 我怎样才能让它打开拨号器?
【问题讨论】:
-
按照我的回答尝试并从
TextView中删除Linkify
标签: android google-maps google-maps-markers phone-number linkify