I got a MapView in my app. I got many OverlayItems in it with a little drawable mark.
If i touch an overlayitem, the onTap() method runs, and i get a little dialog. It is works nice, but sometimes when i try to zoom with multitouch, and my finger is atop of an overlayitem, the dialog comes up after i finished zooming. It is kinda buggy, because it is not so ergonomical, because you have to close the upcoming dialog after you zoomed.
How should i prevent my app from this event ? I dont want onTap() to run when im zooming at all.
I tried it with onTouch events and with 2 booleans but not working:
@Override
public boolean onTouchEvent(MotionEvent event, MapView mapView) {
int action = event.getAction() & MotionEvent.ACTION_MASK;
switch (action) {
case MotionEvent.ACTION_DOWN: {
actionIsDown= true;
break;
}
case MotionEvent.ACTION_POINTER_DOWN: {
pointerIsDown=true;
break;
}
case MotionEvent.ACTION_POINTER_UP: {
pointerIsDown= false;
break;
}
case MotionEvent.ACTION_UP: {
actionIsDown= false;
break;
}
}
return super.onTouchEvent(event, mapView);
}
And the onTap:
@Override
protected boolean onTap(int index)
{
if(pointerIsDown==false && actionIsDown==false){ //...dialog here
Any ideas?