I need to capture a long press, plus the coordinates of the event. It seems to me that a longer threshold or timeout for the long press action will fit better.
final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
public void onLongPress(MotionEvent e) {
//do something with coordinates
}
});
this.fl_overlay.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
gestureDetector.onTouchEvent(event);
return false;
}
});
I see in source code of GestureDetector a
private static final int LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout();
Is there a way to extend this value?