17

Two questions:

  1. Whats the difference between public abstract View getInfoWindow (Marker marker) and public abstract View getInfoContents (Marker marker) .

  2. What is the use of getInfoContents() .

Google map blog says:(getInfoWindow()) allows you to provide a view that will be used for the entire info window. (getInfoContents()) allows you to just customize the contents of the window but still keep the default info window frame and background. . can any one please expalin(try to compare with an existing item, may be like listView row item or so )

Thanks

Basavaraj Hampali
  • 3,905
  • 1
  • 19
  • 22

1 Answers1

28

MapsV2 showing info window

In the above screenshot, I have used an InfoWindowAdapter, where I overrode getInfoContents(). My getInfoContents() method returned the icon and text that you see. My getInfoContents() did not provide the rectangular bubble that the icon and text is in. Also, my getInfoContents() did not provide the caret at the bottom of that bubble that points at the marker, the slight drop shadow behind the bubble, etc.

So, you use getInfoContents() if you want that rectangular bubble, caret, drop shadow, etc. If you do not, and you want to provide the complete info window visual representation, use getInfoWindow().

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Got it, you answer made me clear and implemented your answer to make myself more clearer . You are true . But in my case only getInfoWindow() is needed. In getInfoWindow()'s XML am declering icon and text. Thanks – Basavaraj Hampali Jun 22 '13 at 18:15
  • I know it's an old answer. but is there a way to add the caret at the bottom, when I use getInfoWindow()? – Keselme Apr 04 '18 at 07:46
  • @Keselme: AFAIK, there's no automatic way to do that. I seem to recall that there are a few libraries floating around that create such bubbles, and it's possible that you could integrate one of those. – CommonsWare Apr 04 '18 at 10:28