Hi I’m using google android maps v2 and adding a bunch of markers to the map however I need to add additional data to the marker objects for recall later in the onInfoWindowClick function.
I currently have a MarkerManager singleton class which maintains a concurrent list of venues however inside the onInfoWindowClick function I need to recall this via some form of key from the MarkerManager.
It appears that markers are static final and can’t be extended so I’m a bit stuck on how to do this.
thanks,
Andy
You can create a HashMap:
Then add the markers as keys:
Finally in your Info Window provider, you can retrieve your object via the marker supplied to the
getInfoWindowfunction`: