How to put drawable as a background on InfoWindow (Google Maps API v2 for Android)?
Replace codes in getInfoContents
with getInfoWindow
. The difference between them is getInfoContents
wraps your View
in ViewGroup
with default background.
@Override
public View getInfoWindow(Marker marker) {
// Getting view from the layout file
View v = inflater.inflate(R.layout.map_popup, null);
TextView title = (TextView) v.findViewById(R.id.title);
title.setText(marker.getTitle());
TextView address = (TextView) v.findViewById(R.id.distance);
address.setText(marker.getSnippet());
return v;
}
@Override
public View getInfoContents(Marker arg0) {
// TODO Auto-generated method stub
return null;
}