Search code examples
androidontouchlisteneronlongclicklistener

OnTouch and OnLongPress work together


I impleme

public class TextViewer extends Activity implements OnTouchListener

and

tv.setOnLongClickListener(itemLongClickHandler);
tv.setOnTouchListener(this);

But I only the second one works.

Can I have them both work?


Solution

  • Are you always returning true from onTouch()? You should return false if you want normal event processing to happen.

    There may be a better approach than this - what types of event are you looking to handle in onTouch()?

    Best wishes,

    Phil Lello