Hi, I've got problem with using onTouch and onLongClick events together. My code looks like that: Code (Text): 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?
Hey hollowback Return false, not true. If you return true you are saying that you have consumed the event and it will then be discarded. Note: Actually I am wondering about that. This behaviour seems to be wrong as it is not the same kind of event...But maybe there's a reason for this? Anyone? Update: It's explained here: http://developer.android.com/guide/topics/ui/ui-events.html Cheers.
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