Play Sound On Button Click Android Studio

[Solved] Play Sound On Button Click Android Studio | Swift - Code Explorer | yomemimo.com
Question : play sound on button click android studio

Answered by : depressed-dugong-j2c45am5kxxe

Button one = (Button) this.findViewById(R.id.button1);
final MediaPlayer mp = MediaPlayer.create(this, R.raw.soho);
one.setOnClickListener(new OnClickListener(){ public void onClick(View v) { mp.start(); }
});

Source : https://stackoverflow.com/questions/18459122/play-sound-on-button-click-android | Last Update : Thu, 16 Apr 20

Answers related to play sound on button click android studio

Code Explorer Popular Question For Swift