Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Button click sound in android

Tags:

android

How to disable click sound of a particular button in Android app?

Here is my code:

more1after.setOnClickListener(new OnClickListener() {             public void onClick(View v) {                 sc.scrollTo(sc.getScrollX() + 75,                 sc.getScrollY() + sc.getWidth() + 5);             }         }); 
like image 424
Ankit HTech Avatar asked Mar 08 '13 12:03

Ankit HTech


People also ask

How to disable Sound from phone?

Tap Settings . Tap Notifications. Turn Disable sounds & vibrations on or off. Tap Disable sounds & vibrations to your desired Start time and End time.

What is touch sound?

Touch sounds, are the clicking noises you hear every time you tap something on the screen. You also might want to turn off Vibrate on tap to save some battery, Screen locking sounds since they're pointless, and Dial pad tones so your phone doesn't sound like it's from 40 years ago when you call someone. ALexus.

How do I turn off multiple click on Android?

The actual solution to this problem is to use setEnabled(false) which greys out the button, and setClickable(false) which makes it so the second click can not be received I have tested this and it seem to be very effective.


1 Answers

Try this code for disable button click sound effect:

yourbutton.setSoundEffectsEnabled(false); 

(or) Layout XML file

 <Button... android:soundEffectsEnabled="false"/> 
like image 99
Dinesh Avatar answered Oct 05 '22 01:10

Dinesh