title: How to enable the sound effect on touching a button?
body: <p>If I implement the <code>OnClickListener</code>, the sound effect will work on clicking the button. While on implementing the <code>OnTouchListener</code> the sound effect doesn't work on touching it. So how to enable the sound effect on implementing the <code>OnTouchListener</code>?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here is the code if I use clicking approach:</p>
  
  <pre><code>public class CalculatorActivity extends Activity implements OnClickListener
  {
      //...
      private Button btn1;
      private EditText edLCD;
      //...
  
      public void onCreate(Bundle savedInstanceState)
      {
          //...
          btn1 = (Button) findViewById(R.id.d1);
          btn1.setOnClickListener(this);
  
          edLCD = (EditText) findViewById(R.id.edLCD);
      }
  
      //...
  
      public void onClick(View v)
      {
          edLCD.setText(edLCD.getText().toString() + "1");
      }
  }
  </code></pre>
  
  <p>And here is the code if I use touching approach:</p>
  
  <pre><code>public class CalculatorActivity extends Activity implements OnTouchListener
  {
      //...
      private Button btn1;
      private EditText edLCD;
      //...
  
      public void onCreate(Bundle savedInstanceState)
      {
          //...
          btn1 = (Button) findViewById(R.id.d1);
          btn1.setOnTouchListener(this);
  
          edLCD = (EditText) findViewById(R.id.edLCD);
      }
  
      //...
  
      public boolean onTouch(View v, MotionEvent event)
      {
          if(event.getAction() == MotionEvent.ACTION_DOWN)
          {
              edLCD.setText(edLCD.getText().toString() + "1");
          }
          return true;
      }
  }
  </code></pre>