• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps onTouch and onLongClick together

Hi, I've got problem with using onTouch and onLongClick events together. My code looks like that:
Code:
SurfaceView sv = (SurfaceView)findViewById(...);
sv.setOnLongClickListener(new OnLongClickListener() {         
         @Override
         public boolean onLongClick(View v) {
                                /* ... */
            return true;
         }
      });   
sv.setOnTouchListener(new OnTouchListener() {
         @Override
         public boolean onTouch(View v, MotionEvent event) {
            /* ... */
            return true;
         }
      });
But only onTouch event is proceeded. Is there any solution, how to use this two events together, or to detect longClick in onTouch event?
 
Thank you. I tryied to return false in onLongClick event, but it didn't solve it. If I return false in onTouch event, everything works like charm :)
 
Back
Top Bottom