views:

38

answers:

1

I have hooked in a ScaleGestureDetector to an OnTouchListener as instructed in Android documentation. For some reason the ScaleGestureDetector does not always detect end of a pinch gesture. This happens mostly when pinching fast from large to small.

The effect is that after I have released both fingers the detector does not fire the gesture end event. If I touch the screen with one afterwards it still thinks I'm continuing the scale gesture (keeps firing onScale events). I have to do another gesture to get the detector to fire end event.

I have added logs to the OnTouchListener and when the scale gesture gets stuck I still get motion events normally when using one finger and event.getPointerCount() is 1.

I have made sure that I don't have any other listeners intervening. View that has the onTouchListener is not the only view on screen but this effect happens also when I'm very careful to begin and end the gesture inside this one view.

Is there any way to improve the end detection?

Or if there a way for me to manually set the ScaleGestureDetector to fire onScaleEnd and change scaleGestureDetector.isInProgress() to false?

Thank you! Help very much appreciated!

Juhani