Here is short tutorial how to create custom background for InfoWindow (balloon) on Google Maps V2 for Android.

As you can see the InfoWindowAdapter have two methods : getInfoWindow() and getInfoContents().

To use default background for InfoWindows you need use getInfoContents().

And if you want to use custom background for InfoWindows you need use getInfoWindow().

Lets see screenshot below:

Custom background for InfoWindow on Google Maps V2

Custom background for InfoWindow on Google Maps V2. Click to enlarge

The source code of InfoWindowAdapter is here:

Download it from github

7 Comments

Ganesh · 24 February, 2014 at 16:27

Nice post. saved my time..!!!

irish jack · 18 April, 2014 at 17:54

This is nice if your new infow covers the bubble
I want to make the infowindow semi transparent. When I make my custom infowindow transparent I still have a solid white layout behind it
How do I tone down the real background?

irish jack · 18 April, 2014 at 17:56

in the example above if the orange bg was set to alpha trasparent then the bg would be white gain when in fact what I want is to see the map behind!

varun · 13 August, 2016 at 19:10

where is your balloon.xml

varun · 13 August, 2016 at 19:12

i tried same thing but its not giving rounded corners for infowindow.

varun · 13 August, 2016 at 19:19

just i run the code from github..its not giving rounded corners.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.