How can I change the images on an ImageButton in Android when using a OnTouchListener?

前端 未结 2 1552
南方客
南方客 2021-02-19 21:29

I have the following code which creates an ImageButton and plays a sound when clicked:

ImageButton SoundButton1 = (ImageButton)findViewById(R.id.sound1);
SoundBu         


        
2条回答
  •  一个人的身影
    2021-02-19 21:52

    I think the solution is simple: remove the return true from the ontouchlistener. Since that blocks all further operations that respond to touch and input. Make it return false too.

    This way it will allow other actions to also respond to the touch.

提交回复
热议问题