Hello everyone, tell me how to remove the button click sound in the application. By pressing, a sound (of a certain frequency) is played, but each button press adds its own (not needed) sound.

I tried through:

audioManager =(AudioManager)getSystemService(Context.AUDIO_SERVICE); audioManager.setStreamMute(AudioManager.STREAM_SYSTEM, true); 

But it turns off all the sound. How exactly to register for a button?

  • Still need relevant code. How and how the sound starts, from this you can dance. And you can figure it out yourself by studying 2 appropriate sets of methods for reproducing sounds. - St-St

1 answer 1

Disable standard sound when clicking programmatically:

 button.setSoundEffectsEnabled(false); 

Or from xml:

 <Button ... android:soundEffectsEnabled="false" />