I want to catch any onTouchEvent() on the mapview. After search lots of questions&answers, I found only when I write my own MapView(MyMapView)and define onTouchEvent, then use this MyMapView in main activity.
Is it the only way??
I want to catch any onTouchEvent() on the mapview. After search lots of questions&answers, I found only when I write my own MapView(MyMapView)and define onTouchEvent, then use this MyMapView in main activity.
Is it the only way??
It's actually the simplest way. When you extend the MapView there are only a few methods that you need to implement and they are really straight forward.
You can also use overlays. See this my answer to the question here: http://stackoverflow.com/questions/1772584/how-to-capture-location-from-mapactivity/2144007#2144007
Not sure if all touch events will be routed to the overlay's onTouchEvent
though.