How to get a continuous Touch Event?

后端 未结 7 1577
死守一世寂寞
死守一世寂寞 2021-01-17 14:01

My class extends View and I need to get continuous touch events on it.

If I use:

public boolean onTouchEvent(MotionEvent me) {

    if(me.getAction()         


        
7条回答
  •  礼貌的吻别
    2021-01-17 14:20

    You need to set this properties for the element android:focusable="true" android:clickable="true" if not, just produce the down action.

提交回复
热议问题