Reputation: 32243
I'm using a LinearLayout (with some views inside) for representing the sound On/Off button in the Settings screen.
When I set the OnClickListener to this Layout it automatically plays the system "onClick" sound when clicked.
I'd like to play the sound only when the sound is going from 'NoSound' to 'Sound'. How can I supress the sound in the other case?
Upvotes: 1
Views: 587
Reputation: 6802
Have you tried using setSoundEffectsEnabled(false/true);
which should work as per documentation that
Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching.
Upvotes: 4