Answers for "java android play sound file with variable"

0

java android play sound file with variable

private void playMp3(String nameOfFile){
   MediaPlayer mPlayer = MediaPlayer.create(this, getResources().getIdentifier(nameOfFile, "raw", getPackageName()));
   mPlayer.start();
}
Posted by: Guest on August-12-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language