这是一种情况:
MotionEvent.ACTION_DOWN已经完成了。
但是用户不会拿走他的手指(没有MotionEvent.ACTION_UP)
mapView.isPressed() -否:(
发布于 2013-04-09 00:50:44
创建一个新类:
public class CustomOverlay extends Overlay
{
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapview)
{
if (event.getAction()== MotionEvent.ACTION_DOWN)
{
//put your code;
}
return false;
}
}在MapActivity中,将以下代码放在onCreate方法中:
MapView mapView = (MapView)findViewById(R.id.MapView);
CustomOverlay customOverlay = new CustomOverlay();
List<Overlay> listOverlay = mapView.getOverlays();
listOverlay.add(customOverlay);我希望这对你有帮助。
https://stackoverflow.com/questions/15883921
复制相似问题