I've been following the following thread on Stack Overflow:
custom info window adapter with custom data in map v2
I have seen the answers on the previous comments, and followed them, but I'm not being able to do it.
On the onMarkerClick I'm being able to get the element I associate to the marker on the:
HashMap<Marker, MyObject>
MyObject is the element that contains the data that I want to show on the marker InfoWindow.
What I'm not being able to do is to put the data on the screen. It blows up the application. How can I do it?
I'm using:
TextView markerTitle = (TextView) getActivity().findViewById(R.id.marker_place_name);
markerTitle.setText(MyObject.getName());
The R.id.marker_place_name is like the example tv_lat TextView
on the windowlayout.xml on the mentioned thread.
How can I change it's data correctly to be shown on the marker InfoWindow
?
On the InfoAdapter
getInfoContents()
I'm unable to retrieve MyObject
.