'Play system click sound android java
I need to perform the sound of the click of the device (not custom one) . Ive tried making a fake click to obtain the sound but nothing so far , this is what i have.
fakeClick = new Button(this);
fakeClick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
fakeClick.playSoundEffect(0);
}
});
fakeClick.performClick();
The button gets clicked but not sound played. :(
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|