Android Google Maps v2: How to add marker with multiline snippet? -
does know how add multiline snippet google maps marker? that's code adding markers:
map.getmap().addmarker(new markeroptions() .position(latlng()).snippet(snippettext) .title(header).icon(icon));
i want snippet this:
| header | |foo | |bar |
but when i'm trying set snippettext "foo \n bar", see foo bar
, don't have ideas how make multiline. can me?
it looks need create own "info window" contents make work:
create implementation of
infowindowadapter
overridesgetinfocontents()
return want goinfowindow
framecall
setinfowindowadapter()
ongooglemap
, passing instance ofinfowindowadapter
this sample project demonstrates technique. replacing snippets "foo\nbar"
correctly processes newline. however, more likely, come layout avoids need newline, separate textview
widgets each line in desired visual results.
Comments
Post a Comment