to detect when the user presses my glSurfaceView is there a way to detect when a longclick is made. I'm guessing if I can't find much in the devdocs then it will be some sort of work around method. Something like registering ACTION_DOWN and seeing how long it is before ACTION_UP.
How do you detect long presses on android using opengl-es?
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {public void onLongPress(MotionEvent e) {
Log.e("", "Longpress detected");
}
});
public boolean onTouchEvent(MotionEvent event) {
return gestureDetector.onTouchEvent(event);
};