title: android maps: How to Long Click a Map?
body: <p>How do I long click on a mapview so that a place marker appears at that point on the map? </p>
  
  <p>I tried a couple ways without success: </p>
  
  <p>1) Using <code>setOnLongClickListener</code> on the <code>MapvView</code> which never detected the longclicks.</p>
  
  <p>2) My other idea was to extend <code>MapView</code> to override <code>dispatchTouchEvent</code> .. Create a GestureDetector to respond to longpress callback. But I was stuck midway here as I could not get a handle to my subclassed Mapview. i.e.</p>
  
  <pre><code>MyMapview mymapview; //MyMapView extends MapView
  
  //results in a classcast exception
  mymapView = (MyMapView) findViewById(R.id.map);
  </code></pre>
  
  <p>3) The only other way I know how to try this is: 
  Detect a <code>MotionEvent.ACTION_DOWN</code> and post a delayed runnable to a handler and detect longpress if the two other events: acton_move or an action_up, have not happened.</p>
  
  <p>Can someone provide thoughts on any of these methods to detect long presses? </p>