Rediner Rediner - 1 year ago 80
Android Question

Sliding over buttons?

I was trying for a couple of hours to make this, but I ended up with none.
I would like to make button perform like it was clicked, but with a touch
(act on 0, not on 1). After that, will I be able to 'slide' over these buttons and
make them react in a row?
I am new in this, so please explain me how to make some more advanced actions?

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