Rediner Rediner - 8 months ago 63
Android Question

Sliding over buttons

I want to be able to 'slide' over my buttons and perform like they were each clicked when touched. (Act on 0, not on 1). How can I accomplish this?


button.setOnTouchListener would do the trick

button.setOnTouchListener(new OnTouchListener() {
        public boolean onTouch(View v, MotionEvent event) {
            if (event.getAction() == MotionEvent.ACTION_DOWN ) {
                //Insert desired code here
                return true;
            return false;

Could you explain what you mean by "slide over these buttons and make them react in a row"?