I need to show an Infowindow of a Google map marker without the small triangle at the bottom. Please check the image which I have attached.
In order to use the speechbubble, use the getInfoContents() override.
In order to not use the speechbubble, use getInfoWindow() override.
Example 1:
public class MyCustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private final View myContentsView;
MyCustomInfoWindowAdapter() {
myContentsView = getLayoutInflater().inflate(
R.layout.info_window, null);
}
@Override
public View getInfoWindow(Marker marker) {
return null;
}
@Override
public View getInfoContents(Marker marker) {
TextView tvTitle = ((TextView) myContentsView
.findViewById(R.id.txtTitle));
TextView tvSnippet = ((TextView) myContentsView
.findViewById(R.id.txtSnippet));
tvTitle.setText(marker.getTitle());
tvSnippet.setText(marker.getSnippet());
return myContentsView;
}
}
Result:

Example 2:
public class MyCustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private final View myContentsView;
MyCustomInfoWindowAdapter() {
myContentsView = getLayoutInflater().inflate(
R.layout.info_window, null);
}
@Override
public View getInfoWindow(Marker marker) {
TextView tvTitle = ((TextView) myContentsView
.findViewById(R.id.txtTitle));
TextView tvSnippet = ((TextView) myContentsView
.findViewById(R.id.txtSnippet));
tvTitle.setText(marker.getTitle());
tvSnippet.setText(marker.getSnippet());
return myContentsView;
}
@Override
public View getInfoContents(Marker marker) {
return null;
}
}
Result:

Note, here is the info_window.xml layout file used: