开发者

OnTouch and OnLongPress work together

开发者 https://www.devze.com 2023-02-22 06:50 出处:网络
I impleme public class TextViewer extends Activity implements OnTouchListener and tv.setOnLongClickListener(itemLongClickHandler);

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消