listener for pressing and releasing a button

前端 未结 3 477
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 01:29

How can I listen for when a Button is pressed and released?

3条回答
  •  北海茫月
    2020-12-24 01:45

    onTouchListener is what you are looking for.

    You will need to use the correct MotionEvent.

    This will allow you to handle the different types of "touches".

提交回复
热议问题