Q:

onTouchListener taking long to change backgroung of buttons, Android

In my application the background of buttons should change to another one when the user touch, and get back to the original one when the finger is off, my problem is that touching for a long period makes it change while touching for a short one, doesn't!! here's how I implemented that:
Button b = (Button) findViewById(R.id.b_bb_e_l);
b.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN: {
                    b.setBackgroundResource(R.drawable.button_bb_e_l_selec);
                    break;}

                case MotionEvent.ACTION_UP: {
                    b.setBackgroundResource(R.drawable.button_bb_e_l);
                    break;}
            }
            return false;
        }
    });

A:

You can use drawable and shape to implement it.

Create a file such btn_bg.xml in res/drawable
btn_bg.xml's content:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" 
          android:drawable="@drawable/button_bb_e_l_selected"/>
    <item android:drawable="@drawable/button_bb_e_l"/>
</selector>

Set background to your button:
<Button
        android:background="@drawable/btn_bg"/>

