Rediner Rediner - 1 year ago 96
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?

Answer Source

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"?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download