LONG PRESS DETECTION IN ANDRIOD

ezra heywood

Total Post:145

Points:1019
Posted by  ezra heywood
 901  View(s)
Ratings:
Rate this:
I am currently using
onTouchEvent(MotionEvent event){
}

to detect when the user presses my glSurfaceView is there a way to detect when a long click is made. I'm guessing if I can't find much in the dev docs 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?
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Long press Detection in andriod

    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);
    };

      Modified On Apr-27-2015 04:15:11 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!