Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google Maps API: Hide Marker Snippet

I am using the Google Maps API v2 and am trying to embed a reference ID to a marker info window. When a user clicks on the info window, it should pass the reference ID to a new intent.

I don't actually want the reference ID to be visible to the user. I added the reference ID as a snippet and use marker.getSnippet() to get the reference ID to pass to the new activity. Is there a way to hide the snippet so the user doesn't see it?

like image 505
scientiffic Avatar asked Jan 24 '13 20:01

scientiffic


1 Answers

Customize the info window contents via an InfoWindowAdapter, attached it to your GoogleMap via setInfoWindowAdapter(). Implement onInfoContents() on the adapter to return something that does not contain your snippet.

like image 143
CommonsWare Avatar answered Oct 14 '22 05:10

CommonsWare