https://kotlinlang.org logo
Title
u

user

06/24/2022, 3:51 PM
OsmDroid: where to put the onClick method for Marker? I've put this method in my custom drawMarker() function: fun drawMarker() { marker!!.setOnMarkerClickListener(object : OnMarkerClickListener { override fun onMarkerClick(marker: Marker?, mapView: MapView?): Boolean { ... } } } The funny thing is that the clickListener works even if the drawMarker() is not called. Why? Is it OK for this method to stay there? It seems logical, since it needs the marker. variable from the drawMarker() to work. But...