J'ai testé ton code mais il ne marche pas, le simple click je le détecter avec :
action == MotionEvent.ACTION_UP
j'ai utilisé le code comme suit :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public boolean onTouchEvent(MotionEvent event, MapView mapView) {
final int action = event.getAction();
final int fingersCount = event.getPointerCount();
if ((action == MotionEvent.ACTION_UP)
&& (fingersCount == 2)) {
// Double Tap
fin = true;
...............
return false;
}
// ---when user lifts his finger---
else if ((action == MotionEvent.ACTION_UP)
&& (fingersCount == 1)) {
fin = false;
.................
return false;
}
return true;
} |
Mais il ne detecte que le simple click mais pas le double click, est ce que c'est dû à MotionEvent.ACTION_UP??
Merci d'avance
Partager